]>
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
;
867 var email
= document
.getElementById("iedit_email").value
;
869 if (login
.length
== 0) {
870 notify("Login cannot be blank.");
874 if (level
.length
== 0) {
875 notify("User level cannot be blank.");
881 notify("Saving user...");
883 xmlhttp
.open("GET", "backend.php?op=pref-users&subop=editSave&id=" +
884 user
+ "&l=" + param_escape(login
) + "&al=" + param_escape(level
) +
885 "&e=" + param_escape(email
), true);
887 xmlhttp
.onreadystatechange
=userlist_callback
;
893 function filterEditSave() {
895 var filter
= active_filter
;
897 if (!xmlhttp_ready(xmlhttp
)) {
902 var regexp
= document
.getElementById("iedit_regexp").value
;
903 var descr
= document
.getElementById("iedit_descr").value
;
904 var match
= document
.getElementById("iedit_match");
906 var v_match
= match
[match
.selectedIndex
].text
;
908 var feed
= document
.getElementById("iedit_feed");
909 var feed_id
= feed
[feed
.selectedIndex
].id
;
911 var action
= document
.getElementById("iedit_filter_action");
912 var action_id
= action
[action
.selectedIndex
].id
;
914 // notify("Saving filter " + filter + ": " + regexp + ", " + descr + ", " + match);
916 if (regexp
.length
== 0) {
917 notify("Filter expression cannot be blank.");
921 active_filter
= false;
923 xmlhttp
.open("GET", "backend.php?op=pref-filters&subop=editSave&id=" +
924 filter
+ "&r=" + param_escape(regexp
) + "&d=" + param_escape(descr
) +
925 "&m=" + param_escape(v_match
) + "&fid=" + param_escape(feed_id
) +
926 "&aid=" + param_escape(action_id
), true);
928 notify("Saving filter...");
930 xmlhttp
.onreadystatechange
=filterlist_callback
;
935 function editSelectedLabel() {
936 var rows
= getSelectedLabels();
938 if (rows
.length
== 0) {
939 notify("No labels are selected.");
943 if (rows
.length
> 1) {
944 notify("Please select one label.");
954 function editSelectedUser() {
955 var rows
= getSelectedUsers();
957 if (rows
.length
== 0) {
958 notify("No users are selected.");
962 if (rows
.length
> 1) {
963 notify("Please select one user.");
972 function resetSelectedUserPass() {
973 var rows
= getSelectedUsers();
975 if (rows
.length
== 0) {
976 notify("No users are selected.");
980 if (rows
.length
> 1) {
981 notify("Please select one user.");
985 var ok
= confirm("Reset password of selected user?");
988 notify("Resetting password for selected user...");
992 xmlhttp
.open("GET", "backend.php?op=pref-users&subop=resetPass&id=" +
993 param_escape(id
), true);
994 xmlhttp
.onreadystatechange
=userlist_callback
;
999 function selectedUserDetails() {
1001 if (!xmlhttp_ready(xmlhttp
)) {
1002 printLockingError();
1006 var rows
= getSelectedUsers();
1008 if (rows
.length
== 0) {
1009 notify("No users are selected.");
1013 if (rows
.length
> 1) {
1014 notify("Please select one user.");
1022 xmlhttp
.open("GET", "backend.php?op=user-details&id=" + id
, true);
1023 xmlhttp
.onreadystatechange
=infobox_callback
;
1028 function selectedFeedDetails() {
1030 if (!xmlhttp_ready(xmlhttp
)) {
1031 printLockingError();
1035 var rows
= getSelectedFeeds();
1037 if (rows
.length
== 0) {
1038 notify("No feeds are selected.");
1042 // if (rows.length > 1) {
1043 // notify("Please select one feed.");
1047 // var id = rows[0];
1051 xmlhttp
.open("GET", "backend.php?op=feed-details&id=" +
1052 param_escape(rows
.toString()), true);
1053 xmlhttp
.onreadystatechange
=infobox_callback
;
1058 function editSelectedFilter() {
1059 var rows
= getSelectedFilters();
1061 if (rows
.length
== 0) {
1062 notify("No filters are selected.");
1066 if (rows
.length
> 1) {
1067 notify("Please select one filter.");
1073 editFilter(rows
[0]);
1078 function editSelectedFeed() {
1079 var rows
= getSelectedFeeds();
1081 if (rows
.length
== 0) {
1082 notify("No feeds are selected.");
1086 if (rows
.length
> 1) {
1087 notify("Please select one feed.");
1097 function editSelectedFeedCat() {
1098 var rows
= getSelectedFeedCats();
1100 if (rows
.length
== 0) {
1101 notify("No categories are selected.");
1105 if (rows
.length
> 1) {
1106 notify("Please select one category.");
1112 editFeedCat(rows
[0]);
1116 function localPiggieFunction(enable
) {
1118 piggie
.style
.display
= "block";
1120 notify("I loveded it!!!");
1122 piggie
.style
.display
= "none";
1127 function validateOpmlImport() {
1129 var opml_file
= document
.getElementById("opml_file");
1131 if (opml_file
.value
.length
== 0) {
1132 notify("Please select OPML file to upload.");
1139 function updateFilterList() {
1141 if (!xmlhttp_ready(xmlhttp
)) {
1142 printLockingError();
1146 // document.getElementById("prefContent").innerHTML = "Loading filters, please wait...";
1148 p_notify("Loading, please wait...");
1150 xmlhttp
.open("GET", "backend.php?op=pref-filters", true);
1151 xmlhttp
.onreadystatechange
=filterlist_callback
;
1156 function updateLabelList() {
1158 if (!xmlhttp_ready(xmlhttp
)) {
1159 printLockingError();
1163 p_notify("Loading, please wait...");
1165 // document.getElementById("prefContent").innerHTML = "Loading labels, please wait...";
1167 xmlhttp
.open("GET", "backend.php?op=pref-labels", true);
1168 xmlhttp
.onreadystatechange
=labellist_callback
;
1172 function updatePrefsList() {
1174 if (!xmlhttp_ready(xmlhttp
)) {
1175 printLockingError();
1179 p_notify("Loading, please wait...");
1181 xmlhttp
.open("GET", "backend.php?op=pref-prefs", true);
1182 xmlhttp
.onreadystatechange
=prefslist_callback
;
1187 function selectTab(id
) {
1189 if (!xmlhttp_ready(xmlhttp
)) {
1190 printLockingError();
1194 if (id
== "feedConfig") {
1196 } else if (id
== "filterConfig") {
1198 } else if (id
== "labelConfig") {
1200 } else if (id
== "genConfig") {
1202 } else if (id
== "userConfig") {
1206 var tab
= document
.getElementById(active_tab
+ "Tab");
1209 if (tab
.className
.match("Selected")) {
1210 tab
.className
= "prefsTab";
1214 tab
= document
.getElementById(id
+ "Tab");
1217 if (!tab
.className
.match("Selected")) {
1218 tab
.className
= tab
.className
+ "Selected";
1224 setCookie('ttrss_pref_acttab', active_tab
);
1234 document
.getElementById("prefContent").innerHTML
=
1235 "<b>Fatal error:</b> This program needs XmlHttpRequest " +
1236 "to function properly. Your browser doesn't seem to support it.";
1240 active_tab
= getCookie("ttrss_pref_acttab");
1241 if (!active_tab
) active_tab
= "genConfig";
1242 selectTab(active_tab
);
1244 document
.onkeydown
= hotkey_handler
;
1247 exception_error("init", e
);
1251 function closeInfoBox() {
1252 var box
= document
.getElementById('infoBox');
1253 var shadow
= document
.getElementById('infoBoxShadow');
1256 shadow
.style
.display
= "none";
1258 box
.style
.display
= "none";
1262 function categorizeSelectedFeeds() {
1264 if (!xmlhttp_ready(xmlhttp
)) {
1265 printLockingError();
1269 var sel_rows
= getSelectedFeeds();
1271 var cat_sel
= document
.getElementById("sfeed_set_fcat");
1272 var cat_id
= cat_sel
[cat_sel
.selectedIndex
].id
;
1274 if (sel_rows
.length
> 0) {
1276 notify("Changing category of selected feeds...");
1278 xmlhttp
.open("GET", "backend.php?op=pref-feeds&subop=categorize&ids="+
1279 param_escape(sel_rows
.toString()) + "&cat_id=" + param_escape(cat_id
), true);
1280 xmlhttp
.onreadystatechange
=feedlist_callback
;
1285 notify("Please select some feeds first.");
1291 function validatePrefsReset() {
1292 return confirm("Reset to defaults?");