]>
git.wh0rd.org - tt-rss.git/blob - prefs.js
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 fcat_id
= fcat
[fcat
.selectedIndex
].id
;
681 var pfeed
= document
.getElementById("iedit_parent_feed");
682 var parent_feed_id
= pfeed
[pfeed
.selectedIndex
].id
;
684 if (link
.length
== 0) {
685 notify("Feed link cannot be blank.");
689 if (title
.length
== 0) {
690 notify("Feed title cannot be blank.");
694 var auth_login
= document
.getElementById("iedit_login").value
;
695 var auth_pass
= document
.getElementById("iedit_pass").value
;
699 notify("Saving feed...");
701 var query
= "op=pref-feeds&subop=editSave&id=" +
702 feed
+ "&l=" + param_escape(link
) + "&t=" + param_escape(title
) +
703 "&ui=" + param_escape(upd_intl
) + "&pi=" + param_escape(purge_intl
) +
704 "&catid=" + param_escape(fcat_id
) + "&login=" + param_escape(auth_login
) +
705 "&pfeed=" + param_escape(parent_feed_id
) + "&pass=" + param_escape(auth_pass
);
707 xmlhttp
.open("POST", "backend.php", true);
708 xmlhttp
.onreadystatechange
=feedlist_callback
;
709 xmlhttp
.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
713 exception_error("feedEditSave", e
);
717 function feedCatEditSave() {
719 if (!xmlhttp_ready(xmlhttp
)) {
724 notify("Saving category...");
726 var cat_title
= document
.getElementById("iedit_title").value
;
728 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=saveCat&id=" +
729 param_escape(active_feed_cat
) + "&title=" + param_escape(cat_title
),
731 xmlhttp
.onreadystatechange
=feedlist_callback
;
734 active_feed_cat
= false;
739 function labelTest() {
741 var sqlexp
= document
.getElementById("iedit_expr").value
;
742 var descr
= document
.getElementById("iedit_descr").value
;
744 xmlhttp
.open("GET", "backend.php?op=pref-labels&subop=test&expr=" +
745 param_escape(sqlexp
) + "&descr=" + param_escape(descr
), true);
747 xmlhttp
.onreadystatechange
=infobox_callback
;
752 function displayHelpInfobox(topic_id
) {
754 xmlhttp
.open("GET", "backend.php?op=help&tid=" +
755 param_escape(topic_id
) + "&noheaders=1", true);
757 xmlhttp
.onreadystatechange
=infobox_callback
;
762 function labelEditCancel() {
764 if (!xmlhttp_ready(xmlhttp
)) {
769 active_label
= false;
771 notify("Operation cancelled.");
773 xmlhttp
.open("GET", "backend.php?op=pref-labels", true);
774 xmlhttp
.onreadystatechange
=labellist_callback
;
779 function userEditCancel() {
781 if (!xmlhttp_ready(xmlhttp
)) {
788 notify("Operation cancelled.");
790 xmlhttp
.open("GET", "backend.php?op=pref-users", true);
791 xmlhttp
.onreadystatechange
=userlist_callback
;
796 function filterEditCancel() {
798 if (!xmlhttp_ready(xmlhttp
)) {
803 active_filter
= false;
805 notify("Operation cancelled.");
807 xmlhttp
.open("GET", "backend.php?op=pref-filters", true);
808 xmlhttp
.onreadystatechange
=filterlist_callback
;
813 function labelEditSave() {
815 var label
= active_label
;
817 if (!xmlhttp_ready(xmlhttp
)) {
822 var sqlexp
= document
.getElementById("iedit_expr").value
;
823 var descr
= document
.getElementById("iedit_descr").value
;
825 // notify("Saving label " + sqlexp + ": " + descr);
827 if (sqlexp
.length
== 0) {
828 notify("SQL expression cannot be blank.");
832 if (descr
.length
== 0) {
833 notify("Caption cannot be blank.");
837 notify("Saving label...");
839 active_label
= false;
841 xmlhttp
.open("GET", "backend.php?op=pref-labels&subop=editSave&id=" +
842 label
+ "&s=" + param_escape(sqlexp
) + "&d=" + param_escape(descr
),
845 xmlhttp
.onreadystatechange
=labellist_callback
;
850 function userEditSave() {
852 var user
= active_user
;
854 if (!xmlhttp_ready(xmlhttp
)) {
859 var login
= document
.getElementById("iedit_ulogin").value
;
860 var level
= document
.getElementById("iedit_ulevel").value
;
861 var email
= document
.getElementById("iedit_email").value
;
863 if (login
.length
== 0) {
864 notify("Login cannot be blank.");
868 if (level
.length
== 0) {
869 notify("User level cannot be blank.");
875 notify("Saving user...");
877 xmlhttp
.open("GET", "backend.php?op=pref-users&subop=editSave&id=" +
878 user
+ "&l=" + param_escape(login
) + "&al=" + param_escape(level
) +
879 "&e=" + param_escape(email
), true);
881 xmlhttp
.onreadystatechange
=userlist_callback
;
887 function filterEditSave() {
889 var filter
= active_filter
;
891 if (!xmlhttp_ready(xmlhttp
)) {
896 var regexp
= document
.getElementById("iedit_regexp").value
;
897 var descr
= document
.getElementById("iedit_descr").value
;
898 var match
= document
.getElementById("iedit_match");
900 var v_match
= match
[match
.selectedIndex
].text
;
902 var feed
= document
.getElementById("iedit_feed");
903 var feed_id
= feed
[feed
.selectedIndex
].id
;
905 var action
= document
.getElementById("iedit_filter_action");
906 var action_id
= action
[action
.selectedIndex
].id
;
908 // notify("Saving filter " + filter + ": " + regexp + ", " + descr + ", " + match);
910 if (regexp
.length
== 0) {
911 notify("Filter expression cannot be blank.");
915 active_filter
= false;
917 xmlhttp
.open("GET", "backend.php?op=pref-filters&subop=editSave&id=" +
918 filter
+ "&r=" + param_escape(regexp
) + "&d=" + param_escape(descr
) +
919 "&m=" + param_escape(v_match
) + "&fid=" + param_escape(feed_id
) +
920 "&aid=" + param_escape(action_id
), true);
922 notify("Saving filter...");
924 xmlhttp
.onreadystatechange
=filterlist_callback
;
929 function editSelectedLabel() {
930 var rows
= getSelectedLabels();
932 if (rows
.length
== 0) {
933 notify("No labels are selected.");
937 if (rows
.length
> 1) {
938 notify("Please select one label.");
948 function editSelectedUser() {
949 var rows
= getSelectedUsers();
951 if (rows
.length
== 0) {
952 notify("No users are selected.");
956 if (rows
.length
> 1) {
957 notify("Please select one user.");
966 function resetSelectedUserPass() {
967 var rows
= getSelectedUsers();
969 if (rows
.length
== 0) {
970 notify("No users are selected.");
974 if (rows
.length
> 1) {
975 notify("Please select one user.");
979 var ok
= confirm("Reset password of selected user?");
982 notify("Resetting password for selected user...");
986 xmlhttp
.open("GET", "backend.php?op=pref-users&subop=resetPass&id=" +
987 param_escape(id
), true);
988 xmlhttp
.onreadystatechange
=userlist_callback
;
993 function selectedUserDetails() {
995 if (!xmlhttp_ready(xmlhttp
)) {
1000 var rows
= getSelectedUsers();
1002 if (rows
.length
== 0) {
1003 notify("No users are selected.");
1007 if (rows
.length
> 1) {
1008 notify("Please select one user.");
1016 xmlhttp
.open("GET", "backend.php?op=user-details&id=" + id
, true);
1017 xmlhttp
.onreadystatechange
=infobox_callback
;
1022 function selectedFeedDetails() {
1024 if (!xmlhttp_ready(xmlhttp
)) {
1025 printLockingError();
1029 var rows
= getSelectedFeeds();
1031 if (rows
.length
== 0) {
1032 notify("No feeds are selected.");
1036 // if (rows.length > 1) {
1037 // notify("Please select one feed.");
1041 // var id = rows[0];
1045 xmlhttp
.open("GET", "backend.php?op=feed-details&id=" +
1046 param_escape(rows
.toString()), true);
1047 xmlhttp
.onreadystatechange
=infobox_callback
;
1052 function editSelectedFilter() {
1053 var rows
= getSelectedFilters();
1055 if (rows
.length
== 0) {
1056 notify("No filters are selected.");
1060 if (rows
.length
> 1) {
1061 notify("Please select one filter.");
1067 editFilter(rows
[0]);
1072 function editSelectedFeed() {
1073 var rows
= getSelectedFeeds();
1075 if (rows
.length
== 0) {
1076 notify("No feeds are selected.");
1080 if (rows
.length
> 1) {
1081 notify("Please select one feed.");
1091 function editSelectedFeedCat() {
1092 var rows
= getSelectedFeedCats();
1094 if (rows
.length
== 0) {
1095 notify("No categories are selected.");
1099 if (rows
.length
> 1) {
1100 notify("Please select one category.");
1106 editFeedCat(rows
[0]);
1110 function localPiggieFunction(enable
) {
1112 piggie
.style
.display
= "block";
1114 notify("I loveded it!!!");
1116 piggie
.style
.display
= "none";
1121 function validateOpmlImport() {
1123 var opml_file
= document
.getElementById("opml_file");
1125 if (opml_file
.value
.length
== 0) {
1126 notify("Please select OPML file to upload.");
1133 function updateFilterList() {
1135 if (!xmlhttp_ready(xmlhttp
)) {
1136 printLockingError();
1140 // document.getElementById("prefContent").innerHTML = "Loading filters, please wait...";
1142 p_notify("Loading, please wait...");
1144 xmlhttp
.open("GET", "backend.php?op=pref-filters", true);
1145 xmlhttp
.onreadystatechange
=filterlist_callback
;
1150 function updateLabelList() {
1152 if (!xmlhttp_ready(xmlhttp
)) {
1153 printLockingError();
1157 p_notify("Loading, please wait...");
1159 // document.getElementById("prefContent").innerHTML = "Loading labels, please wait...";
1161 xmlhttp
.open("GET", "backend.php?op=pref-labels", true);
1162 xmlhttp
.onreadystatechange
=labellist_callback
;
1166 function updatePrefsList() {
1168 if (!xmlhttp_ready(xmlhttp
)) {
1169 printLockingError();
1173 p_notify("Loading, please wait...");
1175 xmlhttp
.open("GET", "backend.php?op=pref-prefs", true);
1176 xmlhttp
.onreadystatechange
=prefslist_callback
;
1181 function selectTab(id
) {
1183 if (!xmlhttp_ready(xmlhttp
)) {
1184 printLockingError();
1188 if (id
== "feedConfig") {
1190 } else if (id
== "filterConfig") {
1192 } else if (id
== "labelConfig") {
1194 } else if (id
== "genConfig") {
1196 } else if (id
== "userConfig") {
1200 var tab
= document
.getElementById(active_tab
+ "Tab");
1203 if (tab
.className
.match("Selected")) {
1204 tab
.className
= "prefsTab";
1208 tab
= document
.getElementById(id
+ "Tab");
1211 if (!tab
.className
.match("Selected")) {
1212 tab
.className
= tab
.className
+ "Selected";
1218 setCookie('ttrss_pref_acttab', active_tab
);
1228 document
.getElementById("prefContent").innerHTML
=
1229 "<b>Fatal error:</b> This program needs XmlHttpRequest " +
1230 "to function properly. Your browser doesn't seem to support it.";
1234 active_tab
= getCookie("ttrss_pref_acttab");
1235 if (!active_tab
) active_tab
= "genConfig";
1236 selectTab(active_tab
);
1238 document
.onkeydown
= hotkey_handler
;
1241 exception_error("init", e
);
1245 function closeInfoBox() {
1246 var box
= document
.getElementById('infoBox');
1247 var shadow
= document
.getElementById('infoBoxShadow');
1250 shadow
.style
.display
= "none";
1252 box
.style
.display
= "none";
1256 function categorizeSelectedFeeds() {
1258 if (!xmlhttp_ready(xmlhttp
)) {
1259 printLockingError();
1263 var sel_rows
= getSelectedFeeds();
1265 var cat_sel
= document
.getElementById("sfeed_set_fcat");
1266 var cat_id
= cat_sel
[cat_sel
.selectedIndex
].id
;
1268 if (sel_rows
.length
> 0) {
1270 notify("Changing category of selected feeds...");
1272 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=categorize&ids="+
1273 param_escape(sel_rows
.toString()) + "&cat_id=" + param_escape(cat_id
), true);
1274 xmlhttp
.onreadystatechange
=feedlist_callback
;
1279 notify("Please select some feeds first.");
1285 function validatePrefsReset() {
1286 return confirm("Reset to defaults?");