]> git.wh0rd.org - tt-rss.git/blame - prefs.js
use old-style infobox for IE, misc IE fixes
[tt-rss.git] / prefs.js
CommitLineData
007bda35
AD
1var xmlhttp = false;
2
961513a3 3var active_feed = false;
91ff844a 4var active_feed_cat = false;
a0d53889 5var active_filter = false;
48f0adb0 6var active_label = false;
e6cb77a0 7var active_user = false;
f5a50b25 8var active_tab = false;
c6232e43 9var feed_to_expand = false;
f5a50b25 10
1cac3c31
AD
11var piggie_top = -400;
12var piggie_fwd = true;
13
007bda35
AD
14/*@cc_on @*/
15/*@if (@_jscript_version >= 5)
16// JScript gives us Conditional compilation, we can cope with old IE versions.
17// and security blocked creation of the objects.
18try {
19 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
20} catch (e) {
21 try {
22 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
23 } catch (E) {
24 xmlhttp = false;
25 }
26}
27@end @*/
28
29if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
30 xmlhttp = new XMLHttpRequest();
31}
32
c6232e43
AD
33function expand_feed_callback() {
34 if (xmlhttp.readyState == 4) {
35 try {
36 var container = document.getElementById("BRDET-" + feed_to_expand);
37 container.innerHTML=xmlhttp.responseText;
38 container.style.display = "block";
4d4200a8 39// p_notify("");
c6232e43
AD
40 } catch (e) {
41 exception_error("expand_feed_callback", e);
42 }
43 }
44}
45
007bda35 46function feedlist_callback() {
007bda35 47 if (xmlhttp.readyState == 4) {
47c6c988
AD
48 try {
49 var container = document.getElementById('prefContent');
50 container.innerHTML=xmlhttp.responseText;
a7f22b70
AD
51 selectTab("feedConfig", true);
52
47c6c988
AD
53 if (active_feed) {
54 var row = document.getElementById("FEEDR-" + active_feed);
55 if (row) {
56 if (!row.className.match("Selected")) {
57 row.className = row.className + "Selected";
58 }
59 }
60 var checkbox = document.getElementById("FRCHK-" + active_feed);
61 if (checkbox) {
62 checkbox.checked = true;
63 }
961513a3 64 }
4d4200a8 65// p_notify("");
47c6c988
AD
66 } catch (e) {
67 exception_error("feedlist_callback", e);
961513a3 68 }
007bda35
AD
69 }
70}
71
a0d53889 72function filterlist_callback() {
f5a50b25 73 var container = document.getElementById('prefContent');
a0d53889 74 if (xmlhttp.readyState == 4) {
f5a50b25 75
a0d53889
AD
76 container.innerHTML=xmlhttp.responseText;
77
78 if (active_filter) {
79 var row = document.getElementById("FILRR-" + active_filter);
80 if (row) {
81 if (!row.className.match("Selected")) {
82 row.className = row.className + "Selected";
83 }
84 }
85 var checkbox = document.getElementById("FICHK-" + active_filter);
86
87 if (checkbox) {
88 checkbox.checked = true;
89 }
90 }
4d4200a8 91// p_notify("");
a0d53889
AD
92 }
93}
94
48f0adb0 95function labellist_callback() {
f5a50b25 96 var container = document.getElementById('prefContent');
48f0adb0
AD
97 if (xmlhttp.readyState == 4) {
98 container.innerHTML=xmlhttp.responseText;
99
967955b7 100 if (active_label) {
48f0adb0
AD
101 var row = document.getElementById("LILRR-" + active_label);
102 if (row) {
103 if (!row.className.match("Selected")) {
104 row.className = row.className + "Selected";
105 }
106 }
107 var checkbox = document.getElementById("LICHK-" + active_label);
108
109 if (checkbox) {
110 checkbox.checked = true;
111 }
112 }
4d4200a8 113// p_notify("");
48f0adb0
AD
114 }
115}
4255b24c 116
c6232e43
AD
117function feed_browser_callback() {
118 var container = document.getElementById('prefContent');
119 if (xmlhttp.readyState == 4) {
120 container.innerHTML=xmlhttp.responseText;
4d4200a8 121// p_notify("");
c6232e43
AD
122 }
123}
124
e6cb77a0
AD
125function userlist_callback() {
126 var container = document.getElementById('prefContent');
127 if (xmlhttp.readyState == 4) {
128 container.innerHTML=xmlhttp.responseText;
129
1a7572cb
AD
130 if (active_user) {
131 var row = document.getElementById("UMRR-" + active_user);
e6cb77a0
AD
132 if (row) {
133 if (!row.className.match("Selected")) {
134 row.className = row.className + "Selected";
135 }
136 }
1a7572cb 137 var checkbox = document.getElementById("UMCHK-" + active_user);
e6cb77a0
AD
138
139 if (checkbox) {
140 checkbox.checked = true;
141 }
1a7572cb
AD
142 }
143
4d4200a8 144// p_notify("");
e6cb77a0
AD
145 }
146}
147
4255b24c
AD
148function prefslist_callback() {
149 var container = document.getElementById('prefContent');
150 if (xmlhttp.readyState == 4) {
151
152 container.innerHTML=xmlhttp.responseText;
153
4d4200a8 154// p_notify("");
4255b24c
AD
155 }
156}
157
b1895692
AD
158function gethelp_callback() {
159 var container = document.getElementById('prefHelpBox');
160 if (xmlhttp.readyState == 4) {
161
162 container.innerHTML = xmlhttp.responseText;
163 container.style.display = "block";
164
165 }
166}
4255b24c
AD
167
168
0e091d38
AD
169function notify_callback() {
170 var container = document.getElementById('notify');
171 if (xmlhttp.readyState == 4) {
172 container.innerHTML=xmlhttp.responseText;
173 }
174}
175
b83c7545 176function updateFeedList(sort_key) {
007bda35 177
c0e5a40e 178 if (!xmlhttp_ready(xmlhttp)) {
508a81e1
AD
179 printLockingError();
180 return
181 }
182
f5a50b25
AD
183// document.getElementById("prefContent").innerHTML = "Loading feeds, please wait...";
184
ce3bf408 185// p_notify("Loading, please wait...");
007bda35 186
f932bc9f
AD
187 var feed_search = document.getElementById("feed_search");
188 var search = "";
189 if (feed_search) { search = feed_search.value; }
190
b83c7545 191 xmlhttp.open("GET", "backend.php?op=pref-feeds" +
f932bc9f
AD
192 "&sort=" + param_escape(sort_key) +
193 "&search=" + param_escape(search), true);
007bda35
AD
194 xmlhttp.onreadystatechange=feedlist_callback;
195 xmlhttp.send(null);
196
197}
198
e6cb77a0
AD
199function updateUsersList() {
200
201 if (!xmlhttp_ready(xmlhttp)) {
202 printLockingError();
203 return
204 }
205
206// document.getElementById("prefContent").innerHTML = "Loading feeds, please wait...";
207
ce3bf408 208// p_notify("Loading, please wait...");
e6cb77a0
AD
209
210 xmlhttp.open("GET", "backend.php?op=pref-users", true);
211 xmlhttp.onreadystatechange=userlist_callback;
212 xmlhttp.send(null);
213
214}
215
48f0adb0
AD
216function addLabel() {
217
218 if (!xmlhttp_ready(xmlhttp)) {
219 printLockingError();
220 return
221 }
222
223 var sqlexp = document.getElementById("ladd_expr");
224
225 if (sqlexp.value.length == 0) {
01b3e191 226 alert("Can't add label: missing SQL expression.");
48f0adb0
AD
227 } else {
228 notify("Adding label...");
229
230 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=add&exp=" +
231 param_escape(sqlexp.value), true);
232
233 xmlhttp.onreadystatechange=labellist_callback;
234 xmlhttp.send(null);
235
236 sqlexp.value = "";
237 }
238
239}
240
de435974
AD
241function addFilter() {
242
243 if (!xmlhttp_ready(xmlhttp)) {
244 printLockingError();
245 return
246 }
247
248 var regexp = document.getElementById("fadd_regexp");
249 var match = document.getElementById("fadd_match");
ead60402 250 var feed = document.getElementById("fadd_feed");
19c9cb11 251 var action = document.getElementById("fadd_action");
de435974
AD
252
253 if (regexp.value.length == 0) {
01b3e191 254 alert("Can't add filter: missing filter expression.");
de435974
AD
255 } else {
256 notify("Adding filter...");
257
25cb5736 258 var v_match = match[match.selectedIndex].text;
ead60402 259 var feed_id = feed[feed.selectedIndex].id;
19c9cb11 260 var action_id = action[action.selectedIndex].id;
ead60402 261
de435974 262 xmlhttp.open("GET", "backend.php?op=pref-filters&subop=add&regexp=" +
ead60402 263 param_escape(regexp.value) + "&match=" + v_match +
19c9cb11 264 "&fid=" + param_escape(feed_id) + "&aid=" + param_escape(action_id), true);
de435974
AD
265
266 xmlhttp.onreadystatechange=filterlist_callback;
267 xmlhttp.send(null);
268
269 regexp.value = "";
270 }
271
272}
48f0adb0 273
71ad3959
AD
274function addFeed() {
275
c0e5a40e 276 if (!xmlhttp_ready(xmlhttp)) {
508a81e1
AD
277 printLockingError();
278 return
279 }
280
331900c6
AD
281 var link = document.getElementById("fadd_link");
282
83fe4d6d 283 if (link.value.length == 0) {
0ceded7a 284 alert("Error: No feed URL given.");
2371c520
AD
285 } else if (link.value.match("http://") == null &&
286 link.value.match("https://") == null) {
287 alert("Error: Invalid feed URL.");
331900c6
AD
288 } else {
289 notify("Adding feed...");
290
291 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&link=" +
292 param_escape(link.value), true);
293 xmlhttp.onreadystatechange=feedlist_callback;
294 xmlhttp.send(null);
295
296 link.value = "";
297
298 }
299
300}
301
91ff844a
AD
302function addFeedCat() {
303
304 if (!xmlhttp_ready(xmlhttp)) {
305 printLockingError();
306 return
307 }
308
309 var cat = document.getElementById("fadd_cat");
310
311 if (cat.value.length == 0) {
01b3e191 312 alert("Can't add category: no name specified.");
91ff844a
AD
313 } else {
314 notify("Adding feed category...");
315
316 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=addCat&cat=" +
317 param_escape(cat.value), true);
318 xmlhttp.onreadystatechange=feedlist_callback;
319 xmlhttp.send(null);
320
321 link.value = "";
322
323 }
324
325}
e6cb77a0
AD
326function addUser() {
327
328 if (!xmlhttp_ready(xmlhttp)) {
329 printLockingError();
330 return
331 }
332
333 var sqlexp = document.getElementById("uadd_box");
334
335 if (sqlexp.value.length == 0) {
01b3e191 336 alert("Can't add user: no login specified.");
e6cb77a0
AD
337 } else {
338 notify("Adding user...");
339
340 xmlhttp.open("GET", "backend.php?op=pref-users&subop=add&login=" +
341 param_escape(sqlexp.value), true);
342
343 xmlhttp.onreadystatechange=userlist_callback;
344 xmlhttp.send(null);
345
346 sqlexp.value = "";
347 }
348
349}
350
48f0adb0
AD
351function editLabel(id) {
352
353 if (!xmlhttp_ready(xmlhttp)) {
354 printLockingError();
355 return
356 }
357
358 active_label = id;
359
360 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=edit&id=" +
361 param_escape(id), true);
362 xmlhttp.onreadystatechange=labellist_callback;
363 xmlhttp.send(null);
364
365}
366
e6cb77a0
AD
367function editUser(id) {
368
369 if (!xmlhttp_ready(xmlhttp)) {
370 printLockingError();
371 return
372 }
373
374 active_user = id;
375
376 xmlhttp.open("GET", "backend.php?op=pref-users&subop=edit&id=" +
377 param_escape(id), true);
378 xmlhttp.onreadystatechange=userlist_callback;
379 xmlhttp.send(null);
380
381}
382
a0d53889
AD
383function editFilter(id) {
384
385 if (!xmlhttp_ready(xmlhttp)) {
386 printLockingError();
387 return
388 }
389
390 active_filter = id;
391
392 xmlhttp.open("GET", "backend.php?op=pref-filters&subop=edit&id=" +
393 param_escape(id), true);
394 xmlhttp.onreadystatechange=filterlist_callback;
395 xmlhttp.send(null);
396
397}
398
331900c6
AD
399function editFeed(feed) {
400
508a81e1
AD
401// notify("Editing feed...");
402
c0e5a40e 403 if (!xmlhttp_ready(xmlhttp)) {
508a81e1
AD
404 printLockingError();
405 return
406 }
331900c6 407
961513a3
AD
408 active_feed = feed;
409
0ea4fb50 410/* xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=edit&id=" +
331900c6
AD
411 param_escape(feed), true);
412 xmlhttp.onreadystatechange=feedlist_callback;
0ea4fb50
AD
413 xmlhttp.send(null); */
414
415 selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-', 'FRCHK-', false);
6c12c809
AD
416// selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-'+feed, 'FRCHK-'+feed,
417// true, false);
418
419 selectTableRowById('FEEDR-'+feed, 'FRCHK-'+feed, true);
0ea4fb50
AD
420
421 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" +
422 param_escape(active_feed), true);
423
424 xmlhttp.onreadystatechange=infobox_callback;
331900c6
AD
425 xmlhttp.send(null);
426
427}
428
91ff844a 429function editFeedCat(cat) {
48f0adb0 430
91ff844a
AD
431 if (!xmlhttp_ready(xmlhttp)) {
432 printLockingError();
433 return
48f0adb0
AD
434 }
435
91ff844a 436 active_feed_cat = cat;
e6cb77a0 437
91ff844a
AD
438 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCat&id=" +
439 param_escape(cat), true);
440 xmlhttp.onreadystatechange=feedlist_callback;
441 xmlhttp.send(null);
e6cb77a0 442
e6cb77a0
AD
443}
444
91ff844a
AD
445function getSelectedLabels() {
446 return getSelectedTableRowIds("prefLabelList", "LILRR");
447}
48f0adb0 448
91ff844a
AD
449function getSelectedUsers() {
450 return getSelectedTableRowIds("prefUserList", "UMRR");
a0d53889
AD
451}
452
83fe4d6d 453function getSelectedFeeds() {
91ff844a
AD
454 return getSelectedTableRowIds("prefFeedList", "FEEDR");
455}
331900c6 456
91ff844a
AD
457function getSelectedFilters() {
458 return getSelectedTableRowIds("prefFilterList", "FILRR");
459}
331900c6 460
91ff844a
AD
461function getSelectedFeedCats() {
462 return getSelectedTableRowIds("prefFeedCatList", "FCATR");
83fe4d6d
AD
463}
464
c0ae0fdb
AD
465function getSelectedFeedsFromBrowser() {
466
467 var list = document.getElementById("browseFeedList");
468 if (!list) list = document.getElementById("browseBigFeedList");
469
470 var selected = new Array();
471
472 for (i = 0; i < list.childNodes.length; i++) {
473 var child = list.childNodes[i];
474 if (child.id && child.id.match("FBROW-")) {
475 var id = child.id.replace("FBROW-", "");
476
477 var cb = document.getElementById("FBCHK-" + id);
478
479 if (cb.checked) {
480 selected.push(id);
481 }
482 }
483 }
484
485 return selected;
486}
487
91ff844a 488
01b3e191 489/*function readSelectedFeeds(read) {
83fe4d6d 490
c0e5a40e 491 if (!xmlhttp_ready(xmlhttp)) {
508a81e1
AD
492 printLockingError();
493 return
494 }
495
83fe4d6d
AD
496 var sel_rows = getSelectedFeeds();
497
498 if (sel_rows.length > 0) {
499
4f3a84f4
AD
500 if (!read) {
501 op = "unread";
502 } else {
503 op = "read";
504 }
83fe4d6d 505
4f3a84f4 506 notify("Marking selected feeds as " + op + "...");
83fe4d6d 507
4f3a84f4 508 xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=" + op + "&ids="+
83fe4d6d 509 param_escape(sel_rows.toString()), true);
0e091d38 510 xmlhttp.onreadystatechange=notify_callback;
83fe4d6d
AD
511 xmlhttp.send(null);
512
513 } else {
514
01b3e191 515 alert("No feeds are selected.");
83fe4d6d
AD
516
517 }
01b3e191 518} */
83fe4d6d 519
48f0adb0
AD
520function removeSelectedLabels() {
521
522 if (!xmlhttp_ready(xmlhttp)) {
523 printLockingError();
524 return
525 }
526
527 var sel_rows = getSelectedLabels();
528
529 if (sel_rows.length > 0) {
530
69668465 531 var ok = confirm("Remove selected labels?");
48f0adb0 532
69668465
AD
533 if (ok) {
534 notify("Removing selected labels...");
535
536 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=remove&ids="+
537 param_escape(sel_rows.toString()), true);
538 xmlhttp.onreadystatechange=labellist_callback;
539 xmlhttp.send(null);
540 }
48f0adb0 541 } else {
01b3e191 542 alert("No labels are selected.");
48f0adb0
AD
543 }
544}
545
e6cb77a0
AD
546function removeSelectedUsers() {
547
548 if (!xmlhttp_ready(xmlhttp)) {
549 printLockingError();
550 return
551 }
552
553 var sel_rows = getSelectedUsers();
554
555 if (sel_rows.length > 0) {
556
69668465 557 var ok = confirm("Remove selected users?");
e6cb77a0 558
69668465
AD
559 if (ok) {
560 notify("Removing selected users...");
561
562 xmlhttp.open("GET", "backend.php?op=pref-users&subop=remove&ids="+
563 param_escape(sel_rows.toString()), true);
564 xmlhttp.onreadystatechange=userlist_callback;
565 xmlhttp.send(null);
566 }
e6cb77a0
AD
567
568 } else {
01b3e191 569 alert("No users are selected.");
e6cb77a0
AD
570 }
571}
572
48f0adb0
AD
573function removeSelectedFilters() {
574
575 if (!xmlhttp_ready(xmlhttp)) {
576 printLockingError();
577 return
578 }
579
580 var sel_rows = getSelectedFilters();
581
582 if (sel_rows.length > 0) {
583
69668465 584 var ok = confirm("Remove selected filters?");
48f0adb0 585
69668465
AD
586 if (ok) {
587 notify("Removing selected filters...");
588
589 xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+
590 param_escape(sel_rows.toString()), true);
591 xmlhttp.onreadystatechange=filterlist_callback;
592 xmlhttp.send(null);
593 }
48f0adb0 594 } else {
01b3e191 595 alert("No filters are selected.");
48f0adb0
AD
596 }
597}
598
599
83fe4d6d
AD
600function removeSelectedFeeds() {
601
c0e5a40e 602 if (!xmlhttp_ready(xmlhttp)) {
508a81e1
AD
603 printLockingError();
604 return
605 }
606
83fe4d6d
AD
607 var sel_rows = getSelectedFeeds();
608
331900c6
AD
609 if (sel_rows.length > 0) {
610
1d7bf5a0 611 var ok = confirm("Unsubscribe from selected feeds?");
331900c6 612
69668465
AD
613 if (ok) {
614
1d7bf5a0 615 notify("Unsubscribing from selected feeds...");
69668465
AD
616
617 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+
618 param_escape(sel_rows.toString()), true);
619 xmlhttp.onreadystatechange=feedlist_callback;
620 xmlhttp.send(null);
621 }
71ad3959 622
71ad3959 623 } else {
331900c6 624
01b3e191 625 alert("No feeds are selected.");
331900c6 626
71ad3959
AD
627 }
628
629}
007bda35 630
91ff844a
AD
631function removeSelectedFeedCats() {
632
633 if (!xmlhttp_ready(xmlhttp)) {
634 printLockingError();
635 return
636 }
637
638 var sel_rows = getSelectedFeedCats();
639
640 if (sel_rows.length > 0) {
641
69668465 642 var ok = confirm("Remove selected categories?");
91ff844a 643
69668465
AD
644 if (ok) {
645 notify("Removing selected categories...");
646
647 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+
648 param_escape(sel_rows.toString()), true);
649 xmlhttp.onreadystatechange=feedlist_callback;
650 xmlhttp.send(null);
651 }
91ff844a
AD
652
653 } else {
654
01b3e191 655 alert("No categories are selected.");
91ff844a
AD
656
657 }
658
659}
660
508a81e1
AD
661function feedEditCancel() {
662
c0e5a40e 663 if (!xmlhttp_ready(xmlhttp)) {
508a81e1
AD
664 printLockingError();
665 return
666 }
667
327a3bbe
AD
668 closeInfoBox();
669
961513a3
AD
670 active_feed = false;
671
0ceded7a 672// notify("Operation cancelled.");
508a81e1 673
327a3bbe 674/* xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
508a81e1 675 xmlhttp.onreadystatechange=feedlist_callback;
327a3bbe 676 xmlhttp.send(null); */
508a81e1
AD
677
678}
679
91ff844a
AD
680function feedCatEditCancel() {
681
682 if (!xmlhttp_ready(xmlhttp)) {
683 printLockingError();
684 return
685 }
686
687 active_feed_cat = false;
688
0ceded7a 689// notify("Operation cancelled.");
91ff844a
AD
690
691 xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
692 xmlhttp.onreadystatechange=feedlist_callback;
693 xmlhttp.send(null);
694
695}
696
603c27f8
AD
697function feedEditSave() {
698
47c6c988 699 try {
d148926e 700
47c6c988
AD
701 var feed = active_feed;
702
703 if (!xmlhttp_ready(xmlhttp)) {
704 printLockingError();
705 return
706 }
707
708 var link = document.getElementById("iedit_link").value;
709 var title = document.getElementById("iedit_title").value;
ad815c71
AD
710 var upd_intl = document.getElementById("iedit_updintl");
711
712 upd_intl = upd_intl[upd_intl.selectedIndex].id;
713
714 var purge_intl = document.getElementById("iedit_purgintl");
715
716 purge_intl = purge_intl[purge_intl.selectedIndex].id;
717
47c6c988 718 var fcat = document.getElementById("iedit_fcat");
e3c99f3b 719
19ded366 720 var is_pvt = document.getElementById("iedit_private");
70f6dbb1 721 var is_rtl = document.getElementById("iedit_rtl");
b0da3a7b
AD
722
723 if (is_pvt) {
724 is_pvt = is_pvt.checked;
725 }
70f6dbb1
AD
726
727 if (is_rtl) {
728 is_rtl = is_rtl.checked;
729 }
ac92cb46 730
48fa05ad
AD
731 var fcat_id = 0;
732
733 if (fcat) {
734 fcat_id = fcat[fcat.selectedIndex].id;
735 }
1da7e457
AD
736
737 var pfeed = document.getElementById("iedit_parent_feed");
738 var parent_feed_id = pfeed[pfeed.selectedIndex].id;
47c6c988
AD
739
740 if (link.length == 0) {
741 notify("Feed link cannot be blank.");
742 return;
743 }
744
745 if (title.length == 0) {
746 notify("Feed title cannot be blank.");
747 return;
748 }
749
750 var auth_login = document.getElementById("iedit_login").value;
751 var auth_pass = document.getElementById("iedit_pass").value;
752
753 active_feed = false;
754
755 notify("Saving feed...");
d148926e 756
47c6c988
AD
757 var query = "op=pref-feeds&subop=editSave&id=" +
758 feed + "&l=" + param_escape(link) + "&t=" + param_escape(title) +
759 "&ui=" + param_escape(upd_intl) + "&pi=" + param_escape(purge_intl) +
e3c99f3b
AD
760 "&catid=" + param_escape(fcat_id) + "&login=" + param_escape(auth_login) +
761 "&pfeed=" + param_escape(parent_feed_id) + "&pass=" + param_escape(auth_pass) +
70f6dbb1 762 "&is_pvt=" + param_escape(is_pvt) + "&is_rtl=" + param_escape(is_rtl);
508a81e1 763
47c6c988
AD
764 xmlhttp.open("POST", "backend.php", true);
765 xmlhttp.onreadystatechange=feedlist_callback;
766 xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
b0da3a7b 767 xmlhttp.send(query);
47c6c988
AD
768
769 } catch (e) {
770 exception_error("feedEditSave", e);
b0da3a7b 771 }
508a81e1
AD
772}
773
5ddadb4c
AD
774function feedCatEditSave() {
775
776 if (!xmlhttp_ready(xmlhttp)) {
777 printLockingError();
778 return
779 }
780
f0e81ffe 781 notify("Saving category...");
5ddadb4c
AD
782
783 var cat_title = document.getElementById("iedit_title").value;
784
785 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=saveCat&id=" +
786 param_escape(active_feed_cat) + "&title=" + param_escape(cat_title),
787 true);
788 xmlhttp.onreadystatechange=feedlist_callback;
789 xmlhttp.send(null);
790
791 active_feed_cat = false;
792
793}
794
795
d9dde1d6
AD
796function labelTest() {
797
798 var sqlexp = document.getElementById("iedit_expr").value;
799 var descr = document.getElementById("iedit_descr").value;
800
801 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=test&expr=" +
802 param_escape(sqlexp) + "&descr=" + param_escape(descr), true);
803
804 xmlhttp.onreadystatechange=infobox_callback;
805 xmlhttp.send(null);
806
807}
808
01c9c74a
AD
809function displayHelpInfobox(topic_id) {
810
811 xmlhttp.open("GET", "backend.php?op=help&tid=" +
812 param_escape(topic_id) + "&noheaders=1", true);
813
814 xmlhttp.onreadystatechange=infobox_callback;
815 xmlhttp.send(null);
816
817}
818
48f0adb0
AD
819function labelEditCancel() {
820
821 if (!xmlhttp_ready(xmlhttp)) {
822 printLockingError();
823 return
824 }
825
826 active_label = false;
827
0ceded7a 828// notify("Operation cancelled.");
48f0adb0
AD
829
830 xmlhttp.open("GET", "backend.php?op=pref-labels", true);
831 xmlhttp.onreadystatechange=labellist_callback;
832 xmlhttp.send(null);
833
834}
835
e6cb77a0
AD
836function userEditCancel() {
837
838 if (!xmlhttp_ready(xmlhttp)) {
839 printLockingError();
840 return
841 }
842
843 active_user = false;
844
0ceded7a 845// notify("Operation cancelled.");
e6cb77a0
AD
846
847 xmlhttp.open("GET", "backend.php?op=pref-users", true);
848 xmlhttp.onreadystatechange=userlist_callback;
849 xmlhttp.send(null);
850
851}
48f0adb0 852
a0d53889
AD
853function filterEditCancel() {
854
855 if (!xmlhttp_ready(xmlhttp)) {
856 printLockingError();
857 return
858 }
859
860 active_filter = false;
861
0ceded7a 862// notify("Operation cancelled.");
a0d53889
AD
863
864 xmlhttp.open("GET", "backend.php?op=pref-filters", true);
865 xmlhttp.onreadystatechange=filterlist_callback;
866 xmlhttp.send(null);
867
868}
869
48f0adb0
AD
870function labelEditSave() {
871
872 var label = active_label;
873
874 if (!xmlhttp_ready(xmlhttp)) {
875 printLockingError();
876 return
877 }
878
879 var sqlexp = document.getElementById("iedit_expr").value;
880 var descr = document.getElementById("iedit_descr").value;
881
882// notify("Saving label " + sqlexp + ": " + descr);
883
884 if (sqlexp.length == 0) {
885 notify("SQL expression cannot be blank.");
886 return;
887 }
888
889 if (descr.length == 0) {
890 notify("Caption cannot be blank.");
891 return;
892 }
893
f0e81ffe 894 notify("Saving label...");
dbd9e2f1 895
48f0adb0
AD
896 active_label = false;
897
898 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=editSave&id=" +
899 label + "&s=" + param_escape(sqlexp) + "&d=" + param_escape(descr),
900 true);
901
902 xmlhttp.onreadystatechange=labellist_callback;
903 xmlhttp.send(null);
904
905}
906
e6cb77a0
AD
907function userEditSave() {
908
909 var user = active_user;
910
911 if (!xmlhttp_ready(xmlhttp)) {
912 printLockingError();
913 return
914 }
915
916 var login = document.getElementById("iedit_ulogin").value;
5917a8e4
AD
917 var level = document.getElementById("iedit_ulevel");
918
919 level = level[level.selectedIndex].id;
920
72932a75 921 var email = document.getElementById("iedit_email").value;
e6cb77a0
AD
922
923 if (login.length == 0) {
924 notify("Login cannot be blank.");
925 return;
926 }
927
928 if (level.length == 0) {
929 notify("User level cannot be blank.");
930 return;
931 }
932
933 active_user = false;
934
f0e81ffe 935 notify("Saving user...");
dbd9e2f1 936
e6cb77a0 937 xmlhttp.open("GET", "backend.php?op=pref-users&subop=editSave&id=" +
72932a75
AD
938 user + "&l=" + param_escape(login) + "&al=" + param_escape(level) +
939 "&e=" + param_escape(email), true);
e6cb77a0 940
dbd9e2f1 941 xmlhttp.onreadystatechange=userlist_callback;
e6cb77a0
AD
942 xmlhttp.send(null);
943
944}
945
946
a0d53889
AD
947function filterEditSave() {
948
949 var filter = active_filter;
950
951 if (!xmlhttp_ready(xmlhttp)) {
952 printLockingError();
953 return
954 }
955
956 var regexp = document.getElementById("iedit_regexp").value;
25cb5736 957 var match = document.getElementById("iedit_match");
19c9cb11 958
25cb5736 959 var v_match = match[match.selectedIndex].text;
a0d53889 960
ead60402
AD
961 var feed = document.getElementById("iedit_feed");
962 var feed_id = feed[feed.selectedIndex].id;
963
19c9cb11
AD
964 var action = document.getElementById("iedit_filter_action");
965 var action_id = action[action.selectedIndex].id;
966
a0d53889 967 if (regexp.length == 0) {
01b3e191 968 alert("Can't save filter: match expression is blank.");
a0d53889
AD
969 return;
970 }
971
972 active_filter = false;
973
974 xmlhttp.open("GET", "backend.php?op=pref-filters&subop=editSave&id=" +
01b3e191
AD
975 filter + "&r=" + param_escape(regexp) + "&m=" + param_escape(v_match) +
976 "&fid=" + param_escape(feed_id) + "&aid=" + param_escape(action_id), true);
dbd9e2f1 977
f0e81ffe 978 notify("Saving filter...");
dbd9e2f1 979
a0d53889
AD
980 xmlhttp.onreadystatechange=filterlist_callback;
981 xmlhttp.send(null);
982
983}
984
48f0adb0
AD
985function editSelectedLabel() {
986 var rows = getSelectedLabels();
a0d53889 987
48f0adb0 988 if (rows.length == 0) {
01b3e191 989 alert("No labels are selected.");
48f0adb0 990 return;
a0d53889
AD
991 }
992
48f0adb0 993 if (rows.length > 1) {
01b3e191 994 alert("Please select only one label.");
48f0adb0
AD
995 return;
996 }
a0d53889 997
dbd9e2f1
AD
998 notify("");
999
48f0adb0 1000 editLabel(rows[0]);
a0d53889 1001
a0d53889
AD
1002}
1003
e6cb77a0
AD
1004function editSelectedUser() {
1005 var rows = getSelectedUsers();
1006
1007 if (rows.length == 0) {
01b3e191 1008 alert("No users are selected.");
e6cb77a0
AD
1009 return;
1010 }
1011
1012 if (rows.length > 1) {
01b3e191 1013 alert("Please select only one user.");
e6cb77a0
AD
1014 return;
1015 }
1016
dbd9e2f1
AD
1017 notify("");
1018
e6cb77a0
AD
1019 editUser(rows[0]);
1020}
1021
1022function resetSelectedUserPass() {
1023 var rows = getSelectedUsers();
1024
1025 if (rows.length == 0) {
01b3e191 1026 alert("No users are selected.");
e6cb77a0
AD
1027 return;
1028 }
1029
1030 if (rows.length > 1) {
01b3e191 1031 alert("Please select only one user.");
e6cb77a0
AD
1032 return;
1033 }
1034
69668465 1035 var ok = confirm("Reset password of selected user?");
e6cb77a0 1036
69668465
AD
1037 if (ok) {
1038 notify("Resetting password for selected user...");
1039
1040 var id = rows[0];
1041
1042 xmlhttp.open("GET", "backend.php?op=pref-users&subop=resetPass&id=" +
1043 param_escape(id), true);
1044 xmlhttp.onreadystatechange=userlist_callback;
1045 xmlhttp.send(null);
1046 }
e6cb77a0
AD
1047}
1048
717f5e64 1049function selectedUserDetails() {
e6cb77a0 1050
1a7572cb
AD
1051 if (!xmlhttp_ready(xmlhttp)) {
1052 printLockingError();
1053 return
1054 }
1055
717f5e64
AD
1056 var rows = getSelectedUsers();
1057
1058 if (rows.length == 0) {
01b3e191 1059 alert("No users are selected.");
717f5e64
AD
1060 return;
1061 }
1062
1063 if (rows.length > 1) {
01b3e191 1064 alert("Please select only one user.");
717f5e64
AD
1065 return;
1066 }
1067
1068 var id = rows[0];
1069
dbd9e2f1
AD
1070 notify("");
1071
1a7572cb 1072 xmlhttp.open("GET", "backend.php?op=user-details&id=" + id, true);
c6c3a07f
AD
1073 xmlhttp.onreadystatechange=infobox_callback;
1074 xmlhttp.send(null);
1075
1076}
1077
1078function selectedFeedDetails() {
1079
1080 if (!xmlhttp_ready(xmlhttp)) {
1081 printLockingError();
1082 return
1083 }
1084
1085 var rows = getSelectedFeeds();
1086
1087 if (rows.length == 0) {
01b3e191 1088 alert("No feeds are selected.");
c6c3a07f
AD
1089 return;
1090 }
1091
01b3e191
AD
1092 if (rows.length > 1) {
1093 notify("Please select only one feed.");
1094 return;
1095 }
c6c3a07f 1096
df268d47 1097// var id = rows[0];
c6c3a07f 1098
dbd9e2f1
AD
1099 notify("");
1100
df268d47
AD
1101 xmlhttp.open("GET", "backend.php?op=feed-details&id=" +
1102 param_escape(rows.toString()), true);
c6c3a07f 1103 xmlhttp.onreadystatechange=infobox_callback;
1a7572cb 1104 xmlhttp.send(null);
717f5e64
AD
1105
1106}
a0d53889
AD
1107
1108function editSelectedFilter() {
1109 var rows = getSelectedFilters();
1110
1111 if (rows.length == 0) {
01b3e191 1112 alert("No filters are selected.");
a0d53889
AD
1113 return;
1114 }
1115
1116 if (rows.length > 1) {
01b3e191 1117 alert("Please select only one filter.");
a0d53889
AD
1118 return;
1119 }
1120
dbd9e2f1
AD
1121 notify("");
1122
a0d53889
AD
1123 editFilter(rows[0]);
1124
1125}
1126
1127
508a81e1
AD
1128function editSelectedFeed() {
1129 var rows = getSelectedFeeds();
1130
1131 if (rows.length == 0) {
1132 notify("No feeds are selected.");
1133 return;
1134 }
1135
1136 if (rows.length > 1) {
1137 notify("Please select one feed.");
1138 return;
1139 }
1140
dbd9e2f1
AD
1141 notify("");
1142
508a81e1 1143 editFeed(rows[0]);
91ff844a
AD
1144
1145}
1146
1147function editSelectedFeedCat() {
1148 var rows = getSelectedFeedCats();
1149
1150 if (rows.length == 0) {
01b3e191 1151 alert("No categories are selected.");
91ff844a
AD
1152 return;
1153 }
1154
1155 if (rows.length > 1) {
01b3e191 1156 alert("Please select only one category.");
91ff844a
AD
1157 return;
1158 }
1159
1160 notify("");
1161
1162 editFeedCat(rows[0]);
508a81e1
AD
1163
1164}
1165
1cac3c31
AD
1166function piggie_callback() {
1167 var piggie = document.getElementById("piggie");
1168
1169 piggie.style.top = piggie_top;
e0b6a737
AD
1170 piggie.style.backgroundColor = "white";
1171 piggie.style.borderWidth = "1px";
1cac3c31
AD
1172
1173 if (piggie_fwd && piggie_top < 0) {
1174 setTimeout("piggie_callback()", 50);
1175 piggie_top = piggie_top + 10;
1176 } else if (piggie_fwd && piggie_top >= 0) {
1177 piggie_fwd = false;
1178 setTimeout("piggie_callback()", 50);
1179 } else if (!piggie_fwd && piggie_top > -400) {
1180 setTimeout("piggie_callback()", 50);
1181 piggie_top = piggie_top - 10;
1182 } else if (!piggie_fwd && piggie_top <= -400) {
1183 piggie.style.display = "none";
1184 piggie_fwd = true;
1185 }
1186}
1187
33377ef3
AD
1188var piggie_opacity = 0;
1189
1190function piggie2_callback() {
1191 var piggie = document.getElementById("piggie");
1192 piggie.style.top = 0;
1193 piggie.style.opacity = piggie_opacity;
e0b6a737
AD
1194 piggie.style.backgroundColor = "transparent";
1195 piggie.style.borderWidth = "0px";
33377ef3
AD
1196
1197 if (piggie_fwd && piggie_opacity < 1) {
1198 setTimeout("piggie2_callback()", 50);
1199 piggie_opacity = piggie_opacity + 0.03;
1200 } else if (piggie_fwd && piggie_opacity >= 1) {
1201 piggie_fwd = false;
1202 setTimeout("piggie2_callback()", 50);
1203 } else if (!piggie_fwd && piggie_opacity > 0) {
1204 setTimeout("piggie2_callback()", 50);
1205 piggie_opacity = piggie_opacity - 0.03;
1206 } else if (!piggie_fwd && piggie_opacity <= 0) {
1207 piggie.style.display = "none";
1208 piggie_fwd = true;
1209 }
1210}
1211
13ad9102
AD
1212function localPiggieFunction(enable) {
1213 if (enable) {
1cac3c31 1214 var piggie = document.getElementById("piggie");
508a81e1 1215 piggie.style.display = "block";
33377ef3 1216
1d7bf5a0 1217 if (browser.isNS && Math.random(1) > 0.5) {
33377ef3
AD
1218 piggie2_callback();
1219 } else {
1220 piggie_callback();
1221 }
508a81e1 1222 }
508a81e1
AD
1223}
1224
9f311df6
AD
1225function validateOpmlImport() {
1226
1227 var opml_file = document.getElementById("opml_file");
1228
1229 if (opml_file.value.length == 0) {
01b3e191 1230 alert("No OPML file to upload.");
9f311df6
AD
1231 return false;
1232 } else {
1233 return true;
1234 }
1235}
1236
a0d53889
AD
1237function updateFilterList() {
1238
1239 if (!xmlhttp_ready(xmlhttp)) {
1240 printLockingError();
1241 return
1242 }
1243
f5a50b25
AD
1244// document.getElementById("prefContent").innerHTML = "Loading filters, please wait...";
1245
ce3bf408 1246// p_notify("Loading, please wait...");
a0d53889
AD
1247
1248 xmlhttp.open("GET", "backend.php?op=pref-filters", true);
1249 xmlhttp.onreadystatechange=filterlist_callback;
1250 xmlhttp.send(null);
1251
1252}
1253
48f0adb0
AD
1254function updateLabelList() {
1255
1256 if (!xmlhttp_ready(xmlhttp)) {
1257 printLockingError();
1258 return
1259 }
1260
ce3bf408 1261// p_notify("Loading, please wait...");
f5a50b25
AD
1262
1263// document.getElementById("prefContent").innerHTML = "Loading labels, please wait...";
48f0adb0
AD
1264
1265 xmlhttp.open("GET", "backend.php?op=pref-labels", true);
1266 xmlhttp.onreadystatechange=labellist_callback;
1267 xmlhttp.send(null);
48f0adb0
AD
1268}
1269
4255b24c
AD
1270function updatePrefsList() {
1271
1272 if (!xmlhttp_ready(xmlhttp)) {
1273 printLockingError();
1274 return
1275 }
1276
ce3bf408 1277// p_notify("Loading, please wait...");
4255b24c
AD
1278
1279 xmlhttp.open("GET", "backend.php?op=pref-prefs", true);
1280 xmlhttp.onreadystatechange=prefslist_callback;
1281 xmlhttp.send(null);
1282
1283}
1284
a7f22b70
AD
1285function selectTab(id, noupdate) {
1286
1287// alert(id);
48f0adb0 1288
c6c3a07f
AD
1289 if (!xmlhttp_ready(xmlhttp)) {
1290 printLockingError();
1291 return
1292 }
1293
a7f22b70
AD
1294 if (!noupdate) {
1295
1296 if (id == "feedConfig") {
1297 updateFeedList();
1298 } else if (id == "filterConfig") {
1299 updateFilterList();
1300 } else if (id == "labelConfig") {
1301 updateLabelList();
1302 } else if (id == "genConfig") {
1303 updatePrefsList();
1304 } else if (id == "userConfig") {
1305 updateUsersList();
1306 } else if (id == "feedBrowser") {
1307 updateBigFeedBrowser();
1308 }
a0d53889 1309 }
f5a50b25
AD
1310
1311 var tab = document.getElementById(active_tab + "Tab");
1312
1313 if (tab) {
1314 if (tab.className.match("Selected")) {
1315 tab.className = "prefsTab";
1316 }
1317 }
1318
1319 tab = document.getElementById(id + "Tab");
1320
1321 if (tab) {
1322 if (!tab.className.match("Selected")) {
1323 tab.className = tab.className + "Selected";
1324 }
1325 }
1326
1327 active_tab = id;
1328
4da47970
AD
1329 setCookie('ttrss_pref_acttab', active_tab);
1330
a0d53889
AD
1331}
1332
007bda35 1333function init() {
e2ec66a8 1334
7719618b
AD
1335 try {
1336
97dcd654
AD
1337 if (arguments.callee.done) return;
1338 arguments.callee.done = true;
1339
7719618b
AD
1340 // IE kludge
1341 if (!xmlhttp) {
1342 document.getElementById("prefContent").innerHTML =
1343 "<b>Fatal error:</b> This program needs XmlHttpRequest " +
1344 "to function properly. Your browser doesn't seem to support it.";
1345 return;
1346 }
4da47970
AD
1347
1348 active_tab = getCookie("ttrss_pref_acttab");
1349 if (!active_tab) active_tab = "genConfig";
1350 selectTab(active_tab);
7719618b
AD
1351
1352 document.onkeydown = hotkey_handler;
1353 notify("");
1354 } catch (e) {
1355 exception_error("init", e);
e2ec66a8 1356 }
007bda35 1357}
b1895692 1358
f932bc9f
AD
1359function categorizeSelectedFeeds() {
1360
1361 if (!xmlhttp_ready(xmlhttp)) {
1362 printLockingError();
1363 return
1364 }
1365
1366 var sel_rows = getSelectedFeeds();
1367
1368 var cat_sel = document.getElementById("sfeed_set_fcat");
1369 var cat_id = cat_sel[cat_sel.selectedIndex].id;
1370
1371 if (sel_rows.length > 0) {
1372
1373 notify("Changing category of selected feeds...");
1374
1375 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=categorize&ids="+
1376 param_escape(sel_rows.toString()) + "&cat_id=" + param_escape(cat_id), true);
1377 xmlhttp.onreadystatechange=feedlist_callback;
1378 xmlhttp.send(null);
1379
1380 } else {
1381
01b3e191 1382 alert("No feeds are selected.");
f932bc9f
AD
1383
1384 }
1385
1386}
69668465
AD
1387
1388function validatePrefsReset() {
1389 return confirm("Reset to defaults?");
1390}
f9cb39ac 1391
6311acbe 1392function browseFeeds(limit) {
f9cb39ac
AD
1393
1394 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=browse", true);
1395 xmlhttp.onreadystatechange=infobox_callback;
1396 xmlhttp.send(null);
1397
1398}
a0476535
AD
1399
1400function feedBrowserSubscribe() {
1401 try {
a0476535 1402
c0ae0fdb 1403 var selected = getSelectedFeedsFromBrowser();
a0476535
AD
1404
1405 if (selected.length > 0) {
1406 closeInfoBox();
1407 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=massSubscribe&ids="+
1408 param_escape(selected.toString()), true);
1409 xmlhttp.onreadystatechange=feedlist_callback;
1410 xmlhttp.send(null);
1411 } else {
1412 alert("No feeds are selected.");
1413 }
1414
1415 } catch (e) {
1416 exception_error("feedBrowserSubscribe", e);
1417 }
1418}
c6232e43 1419
6311acbe 1420function updateBigFeedBrowser(limit) {
c6232e43
AD
1421
1422 if (!xmlhttp_ready(xmlhttp)) {
1423 printLockingError();
1424 return
1425 }
1426
ce3bf408 1427// p_notify("Loading, please wait...");
c6232e43 1428
6311acbe
AD
1429 var query = "backend.php?op=pref-feed-browser";
1430
1431 var limit_sel = document.getElementById("feedBrowserLimit");
1432
1433 if (limit_sel) {
1434 var limit = limit_sel[limit_sel.selectedIndex].value;
1435 query = query + "&limit=" + param_escape(limit);
1436 }
1437
1438 xmlhttp.open("GET", query, true);
c6232e43
AD
1439 xmlhttp.onreadystatechange=feed_browser_callback;
1440 xmlhttp.send(null);
c6232e43
AD
1441}
1442
c2b2aee0 1443function browserToggleExpand(id) {
c6232e43
AD
1444 try {
1445/* if (feed_to_expand && feed_to_expand != id) {
1446 var d = document.getElementById("BRDET-" + feed_to_expand);
1447 d.style.display = "none";
1448 } */
c2b2aee0
AD
1449
1450 var d = document.getElementById("BRDET-" + id);
1451
1452 if (d.style.display == "block") {
1453 d.style.display = "none";
1454
1455 } else {
c6232e43 1456
c2b2aee0 1457 feed_to_expand = id;
c6232e43 1458
c2b2aee0
AD
1459 xmlhttp.open("GET", "backend.php?op=pref-feed-browser&subop=details&id="
1460 + param_escape(id), true);
1461 xmlhttp.onreadystatechange=expand_feed_callback;
1462 xmlhttp.send(null);
1463 }
c6232e43
AD
1464
1465 } catch (e) {
1466 exception_error("browserExpand", e);
1467 }
1468}
64dc5976
AD
1469
1470function validateNewPassword(form) {
1471 if (form.OLD_PASSWORD.value == "") {
1472 alert("Current password cannot be blank");
1473 return false;
1474 }
1475 if (form.NEW_PASSWORD.value == "") {
1476 alert("New password cannot be blank");
1477 return false;
1478 }
1479 return true;
1480}
ce3bf408
AD
1481
1482function selectPrefRows(kind, select) {
1483
1484 if (kind) {
1485 var opbarid = false;
1486 var nchk = false;
1487 var nrow = false;
1488 var lname = false;
1489
1490 if (kind == "feed") {
1491 opbarid = "feedOpToolbar";
1492 nrow = "FEEDR-";
1493 nchk = "FRCHK-";
1494 lname = "prefFeedList";
1495 } else if (kind == "fcat") {
1496 opbarid = "catOpToolbar";
1497 nrow = "FCATR-";
1498 nchk = "FCHK-";
1499 lname = "prefFeedCatList";
1500 } else if (kind == "filter") {
1501 opbarid = "filterOpToolbar";
1502 nrow = "FILRR-";
1503 nchk = "FICHK-";
1504 lname = "prefFilterList";
1505 } else if (kind == "label") {
1506 opbarid = "labelOpToolbar";
1507 nrow = "LILRR-";
1508 nchk = "LCHK-";
1509 lname = "prefLabelList";
1510 } else if (kind == "user") {
1511 opbarid = "userOpToolbar";
1512 nrow = "UMRR-";
1513 nchk = "UMCHK-";
1514 lname = "prefUserList";
1515 }
1516
1517 if (opbarid) {
1518 selectTableRowsByIdPrefix(lname, nrow, nchk, select);
1519 disableContainerChildren(opbarid, !select);
1520 }
1521
1522 }
1523}
1524
1525
1526function toggleSelectPrefRow(sender, kind) {
1527
1528 toggleSelectRow(sender);
1529
1530 if (kind) {
1531 var opbarid = false;
1532 var nsel = -1;
1533
1534 if (kind == "feed") {
1535 opbarid = "feedOpToolbar";
1536 nsel = getSelectedFeeds();
1537 } else if (kind == "fcat") {
1538 opbarid = "catOpToolbar";
1539 nsel = getSelectedFeedCats();
1540 } else if (kind == "filter") {
1541 opbarid = "filterOpToolbar";
1542 nsel = getSelectedFilters();
1543 } else if (kind == "label") {
1544 opbarid = "labelOpToolbar";
1545 nsel = getSelectedLabels();
1546 } else if (kind == "user") {
1547 opbarid = "userOpToolbar";
1548 nsel = getSelectedUsers();
1549 }
1550
1551 if (opbarid && nsel != -1) {
1552 disableContainerChildren(opbarid, nsel == false);
1553 }
1554
1555 }
1556}
1557
c0ae0fdb
AD
1558function toggleSelectFBListRow(sender) {
1559 toggleSelectListRow(sender);
1560 disableContainerChildren("fbrOpToolbar", getSelectedFeedsFromBrowser() == 0);
1561}