]>
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
, true);
406 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" +
407 param_escape(active_feed
), true);
409 xmlhttp
.onreadystatechange
=infobox_callback
;
414 function editFeedCat(cat
) {
416 if (!xmlhttp_ready(xmlhttp
)) {
421 active_feed_cat
= cat
;
423 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=editCat&id=" +
424 param_escape(cat
), true);
425 xmlhttp
.onreadystatechange
=feedlist_callback
;
430 function getSelectedLabels() {
431 return getSelectedTableRowIds("prefLabelList", "LILRR");
434 function getSelectedUsers() {
435 return getSelectedTableRowIds("prefUserList", "UMRR");
438 function getSelectedFeeds() {
439 return getSelectedTableRowIds("prefFeedList", "FEEDR");
442 function getSelectedFilters() {
443 return getSelectedTableRowIds("prefFilterList", "FILRR");
446 function getSelectedFeedCats() {
447 return getSelectedTableRowIds("prefFeedCatList", "FCATR");
451 function readSelectedFeeds(read
) {
453 if (!xmlhttp_ready(xmlhttp
)) {
458 var sel_rows
= getSelectedFeeds();
460 if (sel_rows
.length
> 0) {
468 notify("Marking selected feeds as " + op
+ "...");
470 xmlhttp
.open("GET", "backend.php?op=pref-rpc&subop=" + op
+ "&ids="+
471 param_escape(sel_rows
.toString()), true);
472 xmlhttp
.onreadystatechange
=notify_callback
;
477 notify("Please select some feeds first.");
482 function removeSelectedLabels() {
484 if (!xmlhttp_ready(xmlhttp
)) {
489 var sel_rows
= getSelectedLabels();
491 if (sel_rows
.length
> 0) {
493 var ok
= confirm("Remove selected labels?");
496 notify("Removing selected labels...");
498 xmlhttp
.open("GET", "backend.php?op=pref-labels&subop=remove&ids="+
499 param_escape(sel_rows
.toString()), true);
500 xmlhttp
.onreadystatechange
=labellist_callback
;
504 notify("Please select some labels first.");
508 function removeSelectedUsers() {
510 if (!xmlhttp_ready(xmlhttp
)) {
515 var sel_rows
= getSelectedUsers();
517 if (sel_rows
.length
> 0) {
519 var ok
= confirm("Remove selected users?");
522 notify("Removing selected users...");
524 xmlhttp
.open("GET", "backend.php?op=pref-users&subop=remove&ids="+
525 param_escape(sel_rows
.toString()), true);
526 xmlhttp
.onreadystatechange
=userlist_callback
;
531 notify("Please select some labels first.");
535 function removeSelectedFilters() {
537 if (!xmlhttp_ready(xmlhttp
)) {
542 var sel_rows
= getSelectedFilters();
544 if (sel_rows
.length
> 0) {
546 var ok
= confirm("Remove selected filters?");
549 notify("Removing selected filters...");
551 xmlhttp
.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+
552 param_escape(sel_rows
.toString()), true);
553 xmlhttp
.onreadystatechange
=filterlist_callback
;
557 notify("Please select some filters first.");
562 function removeSelectedFeeds() {
564 if (!xmlhttp_ready(xmlhttp
)) {
569 var sel_rows
= getSelectedFeeds();
571 if (sel_rows
.length
> 0) {
573 var ok
= confirm("Remove selected feeds?");
577 notify("Removing selected feeds...");
579 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+
580 param_escape(sel_rows
.toString()), true);
581 xmlhttp
.onreadystatechange
=feedlist_callback
;
587 notify("Please select some feeds first.");
593 function removeSelectedFeedCats() {
595 if (!xmlhttp_ready(xmlhttp
)) {
600 var sel_rows
= getSelectedFeedCats();
602 if (sel_rows
.length
> 0) {
604 var ok
= confirm("Remove selected categories?");
607 notify("Removing selected categories...");
609 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+
610 param_escape(sel_rows
.toString()), true);
611 xmlhttp
.onreadystatechange
=feedlist_callback
;
617 notify("Please select some feeds first.");
623 function feedEditCancel() {
625 if (!xmlhttp_ready(xmlhttp
)) {
634 notify("Operation cancelled.");
636 /* xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
637 xmlhttp.onreadystatechange=feedlist_callback;
638 xmlhttp.send(null); */
642 function feedCatEditCancel() {
644 if (!xmlhttp_ready(xmlhttp
)) {
649 active_feed_cat
= false;
651 notify("Operation cancelled.");
653 xmlhttp
.open("GET", "backend.php?op=pref-feeds", true);
654 xmlhttp
.onreadystatechange
=feedlist_callback
;
659 function feedEditSave() {
663 var feed
= active_feed
;
665 if (!xmlhttp_ready(xmlhttp
)) {
670 var link
= document
.getElementById("iedit_link").value
;
671 var title
= document
.getElementById("iedit_title").value
;
672 var upd_intl
= document
.getElementById("iedit_updintl").value
;
673 var purge_intl
= document
.getElementById("iedit_purgintl").value
;
674 var fcat
= document
.getElementById("iedit_fcat");
676 var fcat_id
= fcat
[fcat
.selectedIndex
].id
;
678 // notify("Saving feed.");
680 /* if (upd_intl < 0) {
681 notify("Update interval must be >= 0 (0 = default)");
685 if (purge_intl < 0) {
686 notify("Purge days must be >= 0 (0 = default)");
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 "&pass=" + param_escape(auth_pass
);
713 xmlhttp
.open("POST", "backend.php", true);
714 xmlhttp
.onreadystatechange
=feedlist_callback
;
715 xmlhttp
.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
719 exception_error("feedEditSave", e
);
723 function feedCatEditSave() {
725 if (!xmlhttp_ready(xmlhttp
)) {
730 notify("Saving category...");
732 var cat_title
= document
.getElementById("iedit_title").value
;
734 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=saveCat&id=" +
735 param_escape(active_feed_cat
) + "&title=" + param_escape(cat_title
),
737 xmlhttp
.onreadystatechange
=feedlist_callback
;
740 active_feed_cat
= false;
745 function labelTest() {
747 var sqlexp
= document
.getElementById("iedit_expr").value
;
748 var descr
= document
.getElementById("iedit_descr").value
;
750 xmlhttp
.open("GET", "backend.php?op=pref-labels&subop=test&expr=" +
751 param_escape(sqlexp
) + "&descr=" + param_escape(descr
), true);
753 xmlhttp
.onreadystatechange
=infobox_callback
;
758 function displayHelpInfobox(topic_id
) {
760 xmlhttp
.open("GET", "backend.php?op=help&tid=" +
761 param_escape(topic_id
) + "&noheaders=1", true);
763 xmlhttp
.onreadystatechange
=infobox_callback
;
768 function labelEditCancel() {
770 if (!xmlhttp_ready(xmlhttp
)) {
775 active_label
= false;
777 notify("Operation cancelled.");
779 xmlhttp
.open("GET", "backend.php?op=pref-labels", true);
780 xmlhttp
.onreadystatechange
=labellist_callback
;
785 function userEditCancel() {
787 if (!xmlhttp_ready(xmlhttp
)) {
794 notify("Operation cancelled.");
796 xmlhttp
.open("GET", "backend.php?op=pref-users", true);
797 xmlhttp
.onreadystatechange
=userlist_callback
;
802 function filterEditCancel() {
804 if (!xmlhttp_ready(xmlhttp
)) {
809 active_filter
= false;
811 notify("Operation cancelled.");
813 xmlhttp
.open("GET", "backend.php?op=pref-filters", true);
814 xmlhttp
.onreadystatechange
=filterlist_callback
;
819 function labelEditSave() {
821 var label
= active_label
;
823 if (!xmlhttp_ready(xmlhttp
)) {
828 var sqlexp
= document
.getElementById("iedit_expr").value
;
829 var descr
= document
.getElementById("iedit_descr").value
;
831 // notify("Saving label " + sqlexp + ": " + descr);
833 if (sqlexp
.length
== 0) {
834 notify("SQL expression cannot be blank.");
838 if (descr
.length
== 0) {
839 notify("Caption cannot be blank.");
843 notify("Saving label...");
845 active_label
= false;
847 xmlhttp
.open("GET", "backend.php?op=pref-labels&subop=editSave&id=" +
848 label
+ "&s=" + param_escape(sqlexp
) + "&d=" + param_escape(descr
),
851 xmlhttp
.onreadystatechange
=labellist_callback
;
856 function userEditSave() {
858 var user
= active_user
;
860 if (!xmlhttp_ready(xmlhttp
)) {
865 var login
= document
.getElementById("iedit_ulogin").value
;
866 var level
= document
.getElementById("iedit_ulevel").value
;
868 if (login
.length
== 0) {
869 notify("Login cannot be blank.");
873 if (level
.length
== 0) {
874 notify("User level cannot be blank.");
880 notify("Saving user...");
882 xmlhttp
.open("GET", "backend.php?op=pref-users&subop=editSave&id=" +
883 user
+ "&l=" + param_escape(login
) + "&al=" + param_escape(level
),
886 xmlhttp
.onreadystatechange
=userlist_callback
;
892 function filterEditSave() {
894 var filter
= active_filter
;
896 if (!xmlhttp_ready(xmlhttp
)) {
901 var regexp
= document
.getElementById("iedit_regexp").value
;
902 var descr
= document
.getElementById("iedit_descr").value
;
903 var match
= document
.getElementById("iedit_match");
905 var v_match
= match
[match
.selectedIndex
].text
;
907 var feed
= document
.getElementById("iedit_feed");
908 var feed_id
= feed
[feed
.selectedIndex
].id
;
910 var action
= document
.getElementById("iedit_filter_action");
911 var action_id
= action
[action
.selectedIndex
].id
;
913 // notify("Saving filter " + filter + ": " + regexp + ", " + descr + ", " + match);
915 if (regexp
.length
== 0) {
916 notify("Filter expression cannot be blank.");
920 active_filter
= false;
922 xmlhttp
.open("GET", "backend.php?op=pref-filters&subop=editSave&id=" +
923 filter
+ "&r=" + param_escape(regexp
) + "&d=" + param_escape(descr
) +
924 "&m=" + param_escape(v_match
) + "&fid=" + param_escape(feed_id
) +
925 "&aid=" + param_escape(action_id
), true);
927 notify("Saving filter...");
929 xmlhttp
.onreadystatechange
=filterlist_callback
;
934 function editSelectedLabel() {
935 var rows
= getSelectedLabels();
937 if (rows
.length
== 0) {
938 notify("No labels are selected.");
942 if (rows
.length
> 1) {
943 notify("Please select one label.");
953 function editSelectedUser() {
954 var rows
= getSelectedUsers();
956 if (rows
.length
== 0) {
957 notify("No users are selected.");
961 if (rows
.length
> 1) {
962 notify("Please select one user.");
971 function resetSelectedUserPass() {
972 var rows
= getSelectedUsers();
974 if (rows
.length
== 0) {
975 notify("No users are selected.");
979 if (rows
.length
> 1) {
980 notify("Please select one user.");
984 var ok
= confirm("Reset password of selected user?");
987 notify("Resetting password for selected user...");
991 xmlhttp
.open("GET", "backend.php?op=pref-users&subop=resetPass&id=" +
992 param_escape(id
), true);
993 xmlhttp
.onreadystatechange
=userlist_callback
;
998 function selectedUserDetails() {
1000 if (!xmlhttp_ready(xmlhttp
)) {
1001 printLockingError();
1005 var rows
= getSelectedUsers();
1007 if (rows
.length
== 0) {
1008 notify("No users are selected.");
1012 if (rows
.length
> 1) {
1013 notify("Please select one user.");
1021 xmlhttp
.open("GET", "backend.php?op=user-details&id=" + id
, true);
1022 xmlhttp
.onreadystatechange
=infobox_callback
;
1027 function selectedFeedDetails() {
1029 if (!xmlhttp_ready(xmlhttp
)) {
1030 printLockingError();
1034 var rows
= getSelectedFeeds();
1036 if (rows
.length
== 0) {
1037 notify("No feeds are selected.");
1041 // if (rows.length > 1) {
1042 // notify("Please select one feed.");
1046 // var id = rows[0];
1050 xmlhttp
.open("GET", "backend.php?op=feed-details&id=" +
1051 param_escape(rows
.toString()), true);
1052 xmlhttp
.onreadystatechange
=infobox_callback
;
1057 function editSelectedFilter() {
1058 var rows
= getSelectedFilters();
1060 if (rows
.length
== 0) {
1061 notify("No filters are selected.");
1065 if (rows
.length
> 1) {
1066 notify("Please select one filter.");
1072 editFilter(rows
[0]);
1077 function editSelectedFeed() {
1078 var rows
= getSelectedFeeds();
1080 if (rows
.length
== 0) {
1081 notify("No feeds are selected.");
1085 if (rows
.length
> 1) {
1086 notify("Please select one feed.");
1096 function editSelectedFeedCat() {
1097 var rows
= getSelectedFeedCats();
1099 if (rows
.length
== 0) {
1100 notify("No categories are selected.");
1104 if (rows
.length
> 1) {
1105 notify("Please select one category.");
1111 editFeedCat(rows
[0]);
1115 function localPiggieFunction(enable
) {
1117 piggie
.style
.display
= "block";
1119 notify("I loveded it!!!");
1121 piggie
.style
.display
= "none";
1126 function validateOpmlImport() {
1128 var opml_file
= document
.getElementById("opml_file");
1130 if (opml_file
.value
.length
== 0) {
1131 notify("Please select OPML file to upload.");
1138 function updateFilterList() {
1140 if (!xmlhttp_ready(xmlhttp
)) {
1141 printLockingError();
1145 // document.getElementById("prefContent").innerHTML = "Loading filters, please wait...";
1147 p_notify("Loading, please wait...");
1149 xmlhttp
.open("GET", "backend.php?op=pref-filters", true);
1150 xmlhttp
.onreadystatechange
=filterlist_callback
;
1155 function updateLabelList() {
1157 if (!xmlhttp_ready(xmlhttp
)) {
1158 printLockingError();
1162 p_notify("Loading, please wait...");
1164 // document.getElementById("prefContent").innerHTML = "Loading labels, please wait...";
1166 xmlhttp
.open("GET", "backend.php?op=pref-labels", true);
1167 xmlhttp
.onreadystatechange
=labellist_callback
;
1171 function updatePrefsList() {
1173 if (!xmlhttp_ready(xmlhttp
)) {
1174 printLockingError();
1178 p_notify("Loading, please wait...");
1180 xmlhttp
.open("GET", "backend.php?op=pref-prefs", true);
1181 xmlhttp
.onreadystatechange
=prefslist_callback
;
1186 function selectTab(id
) {
1188 if (!xmlhttp_ready(xmlhttp
)) {
1189 printLockingError();
1193 if (id
== "feedConfig") {
1195 } else if (id
== "filterConfig") {
1197 } else if (id
== "labelConfig") {
1199 } else if (id
== "genConfig") {
1201 } else if (id
== "userConfig") {
1205 var tab
= document
.getElementById(active_tab
+ "Tab");
1208 if (tab
.className
.match("Selected")) {
1209 tab
.className
= "prefsTab";
1213 tab
= document
.getElementById(id
+ "Tab");
1216 if (!tab
.className
.match("Selected")) {
1217 tab
.className
= tab
.className
+ "Selected";
1223 setCookie('ttrss_pref_acttab', active_tab
);
1233 document
.getElementById("prefContent").innerHTML
=
1234 "<b>Fatal error:</b> This program needs XmlHttpRequest " +
1235 "to function properly. Your browser doesn't seem to support it.";
1239 active_tab
= getCookie("ttrss_pref_acttab");
1240 if (!active_tab
) active_tab
= "genConfig";
1241 selectTab(active_tab
);
1243 document
.onkeydown
= hotkey_handler
;
1246 exception_error("init", e
);
1250 function closeInfoBox() {
1251 var box
= document
.getElementById('infoBox');
1252 var shadow
= document
.getElementById('infoBoxShadow');
1255 shadow
.style
.display
= "none";
1257 box
.style
.display
= "none";
1261 function categorizeSelectedFeeds() {
1263 if (!xmlhttp_ready(xmlhttp
)) {
1264 printLockingError();
1268 var sel_rows
= getSelectedFeeds();
1270 var cat_sel
= document
.getElementById("sfeed_set_fcat");
1271 var cat_id
= cat_sel
[cat_sel
.selectedIndex
].id
;
1273 if (sel_rows
.length
> 0) {
1275 notify("Changing category of selected feeds...");
1277 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=categorize&ids="+
1278 param_escape(sel_rows
.toString()) + "&cat_id=" + param_escape(cat_id
), true);
1279 xmlhttp
.onreadystatechange
=feedlist_callback
;
1284 notify("Please select some feeds first.");
1290 function validatePrefsReset() {
1291 return confirm("Reset to defaults?");