]>
Commit | Line | Data |
---|---|---|
007bda35 AD |
1 | var xmlhttp = false; |
2 | ||
961513a3 | 3 | var active_feed = false; |
91ff844a | 4 | var active_feed_cat = false; |
a0d53889 | 5 | var active_filter = false; |
48f0adb0 | 6 | var active_label = false; |
e6cb77a0 | 7 | var active_user = false; |
961513a3 | 8 | |
f5a50b25 AD |
9 | var active_tab = false; |
10 | ||
007bda35 AD |
11 | /*@cc_on @*/ |
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. | |
15 | try { | |
16 | xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); | |
17 | } catch (e) { | |
18 | try { | |
19 | xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); | |
20 | } catch (E) { | |
21 | xmlhttp = false; | |
22 | } | |
23 | } | |
24 | @end @*/ | |
25 | ||
26 | if (!xmlhttp && typeof XMLHttpRequest!='undefined') { | |
27 | xmlhttp = new XMLHttpRequest(); | |
28 | } | |
29 | ||
007bda35 | 30 | function feedlist_callback() { |
007bda35 | 31 | if (xmlhttp.readyState == 4) { |
47c6c988 AD |
32 | try { |
33 | var container = document.getElementById('prefContent'); | |
34 | container.innerHTML=xmlhttp.responseText; | |
35 | if (active_feed) { | |
36 | var row = document.getElementById("FEEDR-" + active_feed); | |
37 | if (row) { | |
38 | if (!row.className.match("Selected")) { | |
39 | row.className = row.className + "Selected"; | |
40 | } | |
41 | } | |
42 | var checkbox = document.getElementById("FRCHK-" + active_feed); | |
43 | if (checkbox) { | |
44 | checkbox.checked = true; | |
45 | } | |
961513a3 | 46 | } |
47c6c988 AD |
47 | p_notify(""); |
48 | } catch (e) { | |
49 | exception_error("feedlist_callback", e); | |
961513a3 | 50 | } |
007bda35 AD |
51 | } |
52 | } | |
53 | ||
a0d53889 | 54 | function filterlist_callback() { |
f5a50b25 | 55 | var container = document.getElementById('prefContent'); |
a0d53889 | 56 | if (xmlhttp.readyState == 4) { |
f5a50b25 | 57 | |
a0d53889 AD |
58 | container.innerHTML=xmlhttp.responseText; |
59 | ||
60 | if (active_filter) { | |
61 | var row = document.getElementById("FILRR-" + active_filter); | |
62 | if (row) { | |
63 | if (!row.className.match("Selected")) { | |
64 | row.className = row.className + "Selected"; | |
65 | } | |
66 | } | |
67 | var checkbox = document.getElementById("FICHK-" + active_filter); | |
68 | ||
69 | if (checkbox) { | |
70 | checkbox.checked = true; | |
71 | } | |
72 | } | |
f5a50b25 | 73 | p_notify(""); |
a0d53889 AD |
74 | } |
75 | } | |
76 | ||
48f0adb0 | 77 | function labellist_callback() { |
f5a50b25 | 78 | var container = document.getElementById('prefContent'); |
48f0adb0 AD |
79 | if (xmlhttp.readyState == 4) { |
80 | container.innerHTML=xmlhttp.responseText; | |
81 | ||
967955b7 | 82 | if (active_label) { |
48f0adb0 AD |
83 | var row = document.getElementById("LILRR-" + active_label); |
84 | if (row) { | |
85 | if (!row.className.match("Selected")) { | |
86 | row.className = row.className + "Selected"; | |
87 | } | |
88 | } | |
89 | var checkbox = document.getElementById("LICHK-" + active_label); | |
90 | ||
91 | if (checkbox) { | |
92 | checkbox.checked = true; | |
93 | } | |
94 | } | |
f5a50b25 | 95 | p_notify(""); |
48f0adb0 AD |
96 | } |
97 | } | |
4255b24c | 98 | |
e6cb77a0 AD |
99 | function userlist_callback() { |
100 | var container = document.getElementById('prefContent'); | |
101 | if (xmlhttp.readyState == 4) { | |
102 | container.innerHTML=xmlhttp.responseText; | |
103 | ||
1a7572cb AD |
104 | if (active_user) { |
105 | var row = document.getElementById("UMRR-" + active_user); | |
e6cb77a0 AD |
106 | if (row) { |
107 | if (!row.className.match("Selected")) { | |
108 | row.className = row.className + "Selected"; | |
109 | } | |
110 | } | |
1a7572cb | 111 | var checkbox = document.getElementById("UMCHK-" + active_user); |
e6cb77a0 AD |
112 | |
113 | if (checkbox) { | |
114 | checkbox.checked = true; | |
115 | } | |
1a7572cb AD |
116 | } |
117 | ||
e6cb77a0 AD |
118 | p_notify(""); |
119 | } | |
120 | } | |
121 | ||
c6c3a07f | 122 | function infobox_callback() { |
1a7572cb | 123 | if (xmlhttp.readyState == 4) { |
2317ffaa AD |
124 | var box = document.getElementById('infoBox'); |
125 | var shadow = document.getElementById('infoBoxShadow'); | |
126 | ||
127 | if (box) { | |
128 | box.innerHTML=xmlhttp.responseText; | |
129 | if (shadow) { | |
130 | shadow.style.display = "block"; | |
131 | } else { | |
5e9188f2 | 132 | box.style.display = "block"; |
2317ffaa | 133 | } |
c6c3a07f | 134 | } |
1a7572cb AD |
135 | } |
136 | } | |
137 | ||
138 | ||
4255b24c AD |
139 | function prefslist_callback() { |
140 | var container = document.getElementById('prefContent'); | |
141 | if (xmlhttp.readyState == 4) { | |
142 | ||
143 | container.innerHTML=xmlhttp.responseText; | |
144 | ||
145 | p_notify(""); | |
146 | } | |
147 | } | |
148 | ||
b1895692 AD |
149 | function gethelp_callback() { |
150 | var container = document.getElementById('prefHelpBox'); | |
151 | if (xmlhttp.readyState == 4) { | |
152 | ||
153 | container.innerHTML = xmlhttp.responseText; | |
154 | container.style.display = "block"; | |
155 | ||
156 | } | |
157 | } | |
4255b24c AD |
158 | |
159 | ||
0e091d38 AD |
160 | function notify_callback() { |
161 | var container = document.getElementById('notify'); | |
162 | if (xmlhttp.readyState == 4) { | |
163 | container.innerHTML=xmlhttp.responseText; | |
164 | } | |
165 | } | |
166 | ||
b83c7545 | 167 | function updateFeedList(sort_key) { |
007bda35 | 168 | |
c0e5a40e | 169 | if (!xmlhttp_ready(xmlhttp)) { |
508a81e1 AD |
170 | printLockingError(); |
171 | return | |
172 | } | |
173 | ||
f5a50b25 AD |
174 | // document.getElementById("prefContent").innerHTML = "Loading feeds, please wait..."; |
175 | ||
176 | p_notify("Loading, please wait..."); | |
007bda35 | 177 | |
f932bc9f AD |
178 | var feed_search = document.getElementById("feed_search"); |
179 | var search = ""; | |
180 | if (feed_search) { search = feed_search.value; } | |
181 | ||
b83c7545 | 182 | xmlhttp.open("GET", "backend.php?op=pref-feeds" + |
f932bc9f AD |
183 | "&sort=" + param_escape(sort_key) + |
184 | "&search=" + param_escape(search), true); | |
007bda35 AD |
185 | xmlhttp.onreadystatechange=feedlist_callback; |
186 | xmlhttp.send(null); | |
187 | ||
188 | } | |
189 | ||
e6cb77a0 AD |
190 | function updateUsersList() { |
191 | ||
192 | if (!xmlhttp_ready(xmlhttp)) { | |
193 | printLockingError(); | |
194 | return | |
195 | } | |
196 | ||
197 | // document.getElementById("prefContent").innerHTML = "Loading feeds, please wait..."; | |
198 | ||
199 | p_notify("Loading, please wait..."); | |
200 | ||
201 | xmlhttp.open("GET", "backend.php?op=pref-users", true); | |
202 | xmlhttp.onreadystatechange=userlist_callback; | |
203 | xmlhttp.send(null); | |
204 | ||
205 | } | |
206 | ||
48f0adb0 AD |
207 | function addLabel() { |
208 | ||
209 | if (!xmlhttp_ready(xmlhttp)) { | |
210 | printLockingError(); | |
211 | return | |
212 | } | |
213 | ||
214 | var sqlexp = document.getElementById("ladd_expr"); | |
215 | ||
216 | if (sqlexp.value.length == 0) { | |
217 | notify("Missing SQL expression."); | |
218 | } else { | |
219 | notify("Adding label..."); | |
220 | ||
221 | xmlhttp.open("GET", "backend.php?op=pref-labels&subop=add&exp=" + | |
222 | param_escape(sqlexp.value), true); | |
223 | ||
224 | xmlhttp.onreadystatechange=labellist_callback; | |
225 | xmlhttp.send(null); | |
226 | ||
227 | sqlexp.value = ""; | |
228 | } | |
229 | ||
230 | } | |
231 | ||
de435974 AD |
232 | function addFilter() { |
233 | ||
234 | if (!xmlhttp_ready(xmlhttp)) { | |
235 | printLockingError(); | |
236 | return | |
237 | } | |
238 | ||
239 | var regexp = document.getElementById("fadd_regexp"); | |
240 | var match = document.getElementById("fadd_match"); | |
ead60402 | 241 | var feed = document.getElementById("fadd_feed"); |
19c9cb11 | 242 | var action = document.getElementById("fadd_action"); |
de435974 AD |
243 | |
244 | if (regexp.value.length == 0) { | |
245 | notify("Missing filter expression."); | |
246 | } else { | |
247 | notify("Adding filter..."); | |
248 | ||
25cb5736 | 249 | var v_match = match[match.selectedIndex].text; |
ead60402 | 250 | var feed_id = feed[feed.selectedIndex].id; |
19c9cb11 | 251 | var action_id = action[action.selectedIndex].id; |
ead60402 | 252 | |
de435974 | 253 | xmlhttp.open("GET", "backend.php?op=pref-filters&subop=add®exp=" + |
ead60402 | 254 | param_escape(regexp.value) + "&match=" + v_match + |
19c9cb11 | 255 | "&fid=" + param_escape(feed_id) + "&aid=" + param_escape(action_id), true); |
de435974 AD |
256 | |
257 | xmlhttp.onreadystatechange=filterlist_callback; | |
258 | xmlhttp.send(null); | |
259 | ||
260 | regexp.value = ""; | |
261 | } | |
262 | ||
263 | } | |
48f0adb0 | 264 | |
71ad3959 AD |
265 | function addFeed() { |
266 | ||
c0e5a40e | 267 | if (!xmlhttp_ready(xmlhttp)) { |
508a81e1 AD |
268 | printLockingError(); |
269 | return | |
270 | } | |
271 | ||
331900c6 AD |
272 | var link = document.getElementById("fadd_link"); |
273 | ||
83fe4d6d | 274 | if (link.value.length == 0) { |
c753cd32 | 275 | notify("Missing feed URL."); |
331900c6 AD |
276 | } else { |
277 | notify("Adding feed..."); | |
278 | ||
279 | xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&link=" + | |
280 | param_escape(link.value), true); | |
281 | xmlhttp.onreadystatechange=feedlist_callback; | |
282 | xmlhttp.send(null); | |
283 | ||
284 | link.value = ""; | |
285 | ||
286 | } | |
287 | ||
288 | } | |
289 | ||
91ff844a AD |
290 | function addFeedCat() { |
291 | ||
292 | if (!xmlhttp_ready(xmlhttp)) { | |
293 | printLockingError(); | |
294 | return | |
295 | } | |
296 | ||
297 | var cat = document.getElementById("fadd_cat"); | |
298 | ||
299 | if (cat.value.length == 0) { | |
300 | notify("Missing feed category."); | |
301 | } else { | |
302 | notify("Adding feed category..."); | |
303 | ||
304 | xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=addCat&cat=" + | |
305 | param_escape(cat.value), true); | |
306 | xmlhttp.onreadystatechange=feedlist_callback; | |
307 | xmlhttp.send(null); | |
308 | ||
309 | link.value = ""; | |
310 | ||
311 | } | |
312 | ||
313 | } | |
e6cb77a0 AD |
314 | function addUser() { |
315 | ||
316 | if (!xmlhttp_ready(xmlhttp)) { | |
317 | printLockingError(); | |
318 | return | |
319 | } | |
320 | ||
321 | var sqlexp = document.getElementById("uadd_box"); | |
322 | ||
323 | if (sqlexp.value.length == 0) { | |
324 | notify("Missing user login."); | |
325 | } else { | |
326 | notify("Adding user..."); | |
327 | ||
328 | xmlhttp.open("GET", "backend.php?op=pref-users&subop=add&login=" + | |
329 | param_escape(sqlexp.value), true); | |
330 | ||
331 | xmlhttp.onreadystatechange=userlist_callback; | |
332 | xmlhttp.send(null); | |
333 | ||
334 | sqlexp.value = ""; | |
335 | } | |
336 | ||
337 | } | |
338 | ||
48f0adb0 AD |
339 | function editLabel(id) { |
340 | ||
341 | if (!xmlhttp_ready(xmlhttp)) { | |
342 | printLockingError(); | |
343 | return | |
344 | } | |
345 | ||
346 | active_label = id; | |
347 | ||
348 | xmlhttp.open("GET", "backend.php?op=pref-labels&subop=edit&id=" + | |
349 | param_escape(id), true); | |
350 | xmlhttp.onreadystatechange=labellist_callback; | |
351 | xmlhttp.send(null); | |
352 | ||
353 | } | |
354 | ||
e6cb77a0 AD |
355 | function editUser(id) { |
356 | ||
357 | if (!xmlhttp_ready(xmlhttp)) { | |
358 | printLockingError(); | |
359 | return | |
360 | } | |
361 | ||
362 | active_user = id; | |
363 | ||
364 | xmlhttp.open("GET", "backend.php?op=pref-users&subop=edit&id=" + | |
365 | param_escape(id), true); | |
366 | xmlhttp.onreadystatechange=userlist_callback; | |
367 | xmlhttp.send(null); | |
368 | ||
369 | } | |
370 | ||
a0d53889 AD |
371 | function editFilter(id) { |
372 | ||
373 | if (!xmlhttp_ready(xmlhttp)) { | |
374 | printLockingError(); | |
375 | return | |
376 | } | |
377 | ||
378 | active_filter = id; | |
379 | ||
380 | xmlhttp.open("GET", "backend.php?op=pref-filters&subop=edit&id=" + | |
381 | param_escape(id), true); | |
382 | xmlhttp.onreadystatechange=filterlist_callback; | |
383 | xmlhttp.send(null); | |
384 | ||
385 | } | |
386 | ||
331900c6 AD |
387 | function editFeed(feed) { |
388 | ||
508a81e1 AD |
389 | // notify("Editing feed..."); |
390 | ||
c0e5a40e | 391 | if (!xmlhttp_ready(xmlhttp)) { |
508a81e1 AD |
392 | printLockingError(); |
393 | return | |
394 | } | |
331900c6 | 395 | |
961513a3 AD |
396 | active_feed = feed; |
397 | ||
0ea4fb50 | 398 | /* xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=edit&id=" + |
331900c6 AD |
399 | param_escape(feed), true); |
400 | xmlhttp.onreadystatechange=feedlist_callback; | |
0ea4fb50 AD |
401 | xmlhttp.send(null); */ |
402 | ||
403 | selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-', 'FRCHK-', false); | |
404 | selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-'+feed, 'FRCHK-'+feed, true); | |
405 | ||
406 | xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" + | |
407 | param_escape(active_feed), true); | |
408 | ||
409 | xmlhttp.onreadystatechange=infobox_callback; | |
331900c6 AD |
410 | xmlhttp.send(null); |
411 | ||
412 | } | |
413 | ||
91ff844a | 414 | function editFeedCat(cat) { |
48f0adb0 | 415 | |
91ff844a AD |
416 | if (!xmlhttp_ready(xmlhttp)) { |
417 | printLockingError(); | |
418 | return | |
48f0adb0 AD |
419 | } |
420 | ||
91ff844a | 421 | active_feed_cat = cat; |
e6cb77a0 | 422 | |
91ff844a AD |
423 | xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCat&id=" + |
424 | param_escape(cat), true); | |
425 | xmlhttp.onreadystatechange=feedlist_callback; | |
426 | xmlhttp.send(null); | |
e6cb77a0 | 427 | |
e6cb77a0 AD |
428 | } |
429 | ||
91ff844a AD |
430 | function getSelectedLabels() { |
431 | return getSelectedTableRowIds("prefLabelList", "LILRR"); | |
432 | } | |
48f0adb0 | 433 | |
91ff844a AD |
434 | function getSelectedUsers() { |
435 | return getSelectedTableRowIds("prefUserList", "UMRR"); | |
a0d53889 AD |
436 | } |
437 | ||
83fe4d6d | 438 | function getSelectedFeeds() { |
91ff844a AD |
439 | return getSelectedTableRowIds("prefFeedList", "FEEDR"); |
440 | } | |
331900c6 | 441 | |
91ff844a AD |
442 | function getSelectedFilters() { |
443 | return getSelectedTableRowIds("prefFilterList", "FILRR"); | |
444 | } | |
331900c6 | 445 | |
91ff844a AD |
446 | function getSelectedFeedCats() { |
447 | return getSelectedTableRowIds("prefFeedCatList", "FCATR"); | |
83fe4d6d AD |
448 | } |
449 | ||
91ff844a | 450 | |
4f3a84f4 | 451 | function readSelectedFeeds(read) { |
83fe4d6d | 452 | |
c0e5a40e | 453 | if (!xmlhttp_ready(xmlhttp)) { |
508a81e1 AD |
454 | printLockingError(); |
455 | return | |
456 | } | |
457 | ||
83fe4d6d AD |
458 | var sel_rows = getSelectedFeeds(); |
459 | ||
460 | if (sel_rows.length > 0) { | |
461 | ||
4f3a84f4 AD |
462 | if (!read) { |
463 | op = "unread"; | |
464 | } else { | |
465 | op = "read"; | |
466 | } | |
83fe4d6d | 467 | |
4f3a84f4 | 468 | notify("Marking selected feeds as " + op + "..."); |
83fe4d6d | 469 | |
4f3a84f4 | 470 | xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=" + op + "&ids="+ |
83fe4d6d | 471 | param_escape(sel_rows.toString()), true); |
0e091d38 | 472 | xmlhttp.onreadystatechange=notify_callback; |
83fe4d6d AD |
473 | xmlhttp.send(null); |
474 | ||
475 | } else { | |
476 | ||
c753cd32 | 477 | notify("Please select some feeds first."); |
83fe4d6d AD |
478 | |
479 | } | |
480 | } | |
481 | ||
48f0adb0 AD |
482 | function removeSelectedLabels() { |
483 | ||
484 | if (!xmlhttp_ready(xmlhttp)) { | |
485 | printLockingError(); | |
486 | return | |
487 | } | |
488 | ||
489 | var sel_rows = getSelectedLabels(); | |
490 | ||
491 | if (sel_rows.length > 0) { | |
492 | ||
69668465 | 493 | var ok = confirm("Remove selected labels?"); |
48f0adb0 | 494 | |
69668465 AD |
495 | if (ok) { |
496 | notify("Removing selected labels..."); | |
497 | ||
498 | xmlhttp.open("GET", "backend.php?op=pref-labels&subop=remove&ids="+ | |
499 | param_escape(sel_rows.toString()), true); | |
500 | xmlhttp.onreadystatechange=labellist_callback; | |
501 | xmlhttp.send(null); | |
502 | } | |
48f0adb0 AD |
503 | } else { |
504 | notify("Please select some labels first."); | |
505 | } | |
506 | } | |
507 | ||
e6cb77a0 AD |
508 | function removeSelectedUsers() { |
509 | ||
510 | if (!xmlhttp_ready(xmlhttp)) { | |
511 | printLockingError(); | |
512 | return | |
513 | } | |
514 | ||
515 | var sel_rows = getSelectedUsers(); | |
516 | ||
517 | if (sel_rows.length > 0) { | |
518 | ||
69668465 | 519 | var ok = confirm("Remove selected users?"); |
e6cb77a0 | 520 | |
69668465 AD |
521 | if (ok) { |
522 | notify("Removing selected users..."); | |
523 | ||
524 | xmlhttp.open("GET", "backend.php?op=pref-users&subop=remove&ids="+ | |
525 | param_escape(sel_rows.toString()), true); | |
526 | xmlhttp.onreadystatechange=userlist_callback; | |
527 | xmlhttp.send(null); | |
528 | } | |
e6cb77a0 AD |
529 | |
530 | } else { | |
531 | notify("Please select some labels first."); | |
532 | } | |
533 | } | |
534 | ||
48f0adb0 AD |
535 | function removeSelectedFilters() { |
536 | ||
537 | if (!xmlhttp_ready(xmlhttp)) { | |
538 | printLockingError(); | |
539 | return | |
540 | } | |
541 | ||
542 | var sel_rows = getSelectedFilters(); | |
543 | ||
544 | if (sel_rows.length > 0) { | |
545 | ||
69668465 | 546 | var ok = confirm("Remove selected filters?"); |
48f0adb0 | 547 | |
69668465 AD |
548 | if (ok) { |
549 | notify("Removing selected filters..."); | |
550 | ||
551 | xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+ | |
552 | param_escape(sel_rows.toString()), true); | |
553 | xmlhttp.onreadystatechange=filterlist_callback; | |
554 | xmlhttp.send(null); | |
555 | } | |
48f0adb0 AD |
556 | } else { |
557 | notify("Please select some filters first."); | |
558 | } | |
559 | } | |
560 | ||
561 | ||
83fe4d6d AD |
562 | function removeSelectedFeeds() { |
563 | ||
c0e5a40e | 564 | if (!xmlhttp_ready(xmlhttp)) { |
508a81e1 AD |
565 | printLockingError(); |
566 | return | |
567 | } | |
568 | ||
83fe4d6d AD |
569 | var sel_rows = getSelectedFeeds(); |
570 | ||
331900c6 AD |
571 | if (sel_rows.length > 0) { |
572 | ||
69668465 | 573 | var ok = confirm("Remove selected feeds?"); |
331900c6 | 574 | |
69668465 AD |
575 | if (ok) { |
576 | ||
577 | notify("Removing selected feeds..."); | |
578 | ||
579 | xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+ | |
580 | param_escape(sel_rows.toString()), true); | |
581 | xmlhttp.onreadystatechange=feedlist_callback; | |
582 | xmlhttp.send(null); | |
583 | } | |
71ad3959 | 584 | |
71ad3959 | 585 | } else { |
331900c6 | 586 | |
c753cd32 | 587 | notify("Please select some feeds first."); |
331900c6 | 588 | |
71ad3959 AD |
589 | } |
590 | ||
591 | } | |
007bda35 | 592 | |
91ff844a AD |
593 | function removeSelectedFeedCats() { |
594 | ||
595 | if (!xmlhttp_ready(xmlhttp)) { | |
596 | printLockingError(); | |
597 | return | |
598 | } | |
599 | ||
600 | var sel_rows = getSelectedFeedCats(); | |
601 | ||
602 | if (sel_rows.length > 0) { | |
603 | ||
69668465 | 604 | var ok = confirm("Remove selected categories?"); |
91ff844a | 605 | |
69668465 AD |
606 | if (ok) { |
607 | notify("Removing selected categories..."); | |
608 | ||
609 | xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+ | |
610 | param_escape(sel_rows.toString()), true); | |
611 | xmlhttp.onreadystatechange=feedlist_callback; | |
612 | xmlhttp.send(null); | |
613 | } | |
91ff844a AD |
614 | |
615 | } else { | |
616 | ||
617 | notify("Please select some feeds first."); | |
618 | ||
619 | } | |
620 | ||
621 | } | |
622 | ||
508a81e1 AD |
623 | function feedEditCancel() { |
624 | ||
c0e5a40e | 625 | if (!xmlhttp_ready(xmlhttp)) { |
508a81e1 AD |
626 | printLockingError(); |
627 | return | |
628 | } | |
629 | ||
327a3bbe AD |
630 | closeInfoBox(); |
631 | ||
961513a3 AD |
632 | active_feed = false; |
633 | ||
508a81e1 AD |
634 | notify("Operation cancelled."); |
635 | ||
327a3bbe | 636 | /* xmlhttp.open("GET", "backend.php?op=pref-feeds", true); |
508a81e1 | 637 | xmlhttp.onreadystatechange=feedlist_callback; |
327a3bbe | 638 | xmlhttp.send(null); */ |
508a81e1 AD |
639 | |
640 | } | |
641 | ||
91ff844a AD |
642 | function feedCatEditCancel() { |
643 | ||
644 | if (!xmlhttp_ready(xmlhttp)) { | |
645 | printLockingError(); | |
646 | return | |
647 | } | |
648 | ||
649 | active_feed_cat = false; | |
650 | ||
651 | notify("Operation cancelled."); | |
652 | ||
653 | xmlhttp.open("GET", "backend.php?op=pref-feeds", true); | |
654 | xmlhttp.onreadystatechange=feedlist_callback; | |
655 | xmlhttp.send(null); | |
656 | ||
657 | } | |
658 | ||
603c27f8 AD |
659 | function feedEditSave() { |
660 | ||
47c6c988 | 661 | try { |
d148926e | 662 | |
47c6c988 AD |
663 | var feed = active_feed; |
664 | ||
665 | if (!xmlhttp_ready(xmlhttp)) { | |
666 | printLockingError(); | |
667 | return | |
668 | } | |
669 | ||
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"); | |
675 | ||
676 | var fcat_id = fcat[fcat.selectedIndex].id; | |
677 | ||
678 | // notify("Saving feed."); | |
679 | ||
680 | /* if (upd_intl < 0) { | |
681 | notify("Update interval must be >= 0 (0 = default)"); | |
682 | return; | |
683 | } | |
684 | ||
685 | if (purge_intl < 0) { | |
686 | notify("Purge days must be >= 0 (0 = default)"); | |
687 | return; | |
688 | } */ | |
689 | ||
690 | if (link.length == 0) { | |
691 | notify("Feed link cannot be blank."); | |
692 | return; | |
693 | } | |
694 | ||
695 | if (title.length == 0) { | |
696 | notify("Feed title cannot be blank."); | |
697 | return; | |
698 | } | |
699 | ||
700 | var auth_login = document.getElementById("iedit_login").value; | |
701 | var auth_pass = document.getElementById("iedit_pass").value; | |
702 | ||
703 | active_feed = false; | |
704 | ||
705 | notify("Saving feed..."); | |
d148926e | 706 | |
47c6c988 AD |
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); | |
508a81e1 | 712 | |
47c6c988 AD |
713 | xmlhttp.open("POST", "backend.php", true); |
714 | xmlhttp.onreadystatechange=feedlist_callback; | |
715 | xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); | |
716 | xmlhttp.send(query); | |
717 | ||
718 | } catch (e) { | |
719 | exception_error("feedEditSave", e); | |
508a81e1 | 720 | } |
508a81e1 AD |
721 | } |
722 | ||
5ddadb4c AD |
723 | function feedCatEditSave() { |
724 | ||
725 | if (!xmlhttp_ready(xmlhttp)) { | |
726 | printLockingError(); | |
727 | return | |
728 | } | |
729 | ||
f0e81ffe | 730 | notify("Saving category..."); |
5ddadb4c AD |
731 | |
732 | var cat_title = document.getElementById("iedit_title").value; | |
733 | ||
734 | xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=saveCat&id=" + | |
735 | param_escape(active_feed_cat) + "&title=" + param_escape(cat_title), | |
736 | true); | |
737 | xmlhttp.onreadystatechange=feedlist_callback; | |
738 | xmlhttp.send(null); | |
739 | ||
740 | active_feed_cat = false; | |
741 | ||
742 | } | |
743 | ||
744 | ||
d9dde1d6 AD |
745 | function labelTest() { |
746 | ||
747 | var sqlexp = document.getElementById("iedit_expr").value; | |
748 | var descr = document.getElementById("iedit_descr").value; | |
749 | ||
750 | xmlhttp.open("GET", "backend.php?op=pref-labels&subop=test&expr=" + | |
751 | param_escape(sqlexp) + "&descr=" + param_escape(descr), true); | |
752 | ||
753 | xmlhttp.onreadystatechange=infobox_callback; | |
754 | xmlhttp.send(null); | |
755 | ||
756 | } | |
757 | ||
01c9c74a AD |
758 | function displayHelpInfobox(topic_id) { |
759 | ||
760 | xmlhttp.open("GET", "backend.php?op=help&tid=" + | |
761 | param_escape(topic_id) + "&noheaders=1", true); | |
762 | ||
763 | xmlhttp.onreadystatechange=infobox_callback; | |
764 | xmlhttp.send(null); | |
765 | ||
766 | } | |
767 | ||
48f0adb0 AD |
768 | function labelEditCancel() { |
769 | ||
770 | if (!xmlhttp_ready(xmlhttp)) { | |
771 | printLockingError(); | |
772 | return | |
773 | } | |
774 | ||
775 | active_label = false; | |
776 | ||
777 | notify("Operation cancelled."); | |
778 | ||
779 | xmlhttp.open("GET", "backend.php?op=pref-labels", true); | |
780 | xmlhttp.onreadystatechange=labellist_callback; | |
781 | xmlhttp.send(null); | |
782 | ||
783 | } | |
784 | ||
e6cb77a0 AD |
785 | function userEditCancel() { |
786 | ||
787 | if (!xmlhttp_ready(xmlhttp)) { | |
788 | printLockingError(); | |
789 | return | |
790 | } | |
791 | ||
792 | active_user = false; | |
793 | ||
794 | notify("Operation cancelled."); | |
795 | ||
796 | xmlhttp.open("GET", "backend.php?op=pref-users", true); | |
797 | xmlhttp.onreadystatechange=userlist_callback; | |
798 | xmlhttp.send(null); | |
799 | ||
800 | } | |
48f0adb0 | 801 | |
a0d53889 AD |
802 | function filterEditCancel() { |
803 | ||
804 | if (!xmlhttp_ready(xmlhttp)) { | |
805 | printLockingError(); | |
806 | return | |
807 | } | |
808 | ||
809 | active_filter = false; | |
810 | ||
811 | notify("Operation cancelled."); | |
812 | ||
813 | xmlhttp.open("GET", "backend.php?op=pref-filters", true); | |
814 | xmlhttp.onreadystatechange=filterlist_callback; | |
815 | xmlhttp.send(null); | |
816 | ||
817 | } | |
818 | ||
48f0adb0 AD |
819 | function labelEditSave() { |
820 | ||
821 | var label = active_label; | |
822 | ||
823 | if (!xmlhttp_ready(xmlhttp)) { | |
824 | printLockingError(); | |
825 | return | |
826 | } | |
827 | ||
828 | var sqlexp = document.getElementById("iedit_expr").value; | |
829 | var descr = document.getElementById("iedit_descr").value; | |
830 | ||
831 | // notify("Saving label " + sqlexp + ": " + descr); | |
832 | ||
833 | if (sqlexp.length == 0) { | |
834 | notify("SQL expression cannot be blank."); | |
835 | return; | |
836 | } | |
837 | ||
838 | if (descr.length == 0) { | |
839 | notify("Caption cannot be blank."); | |
840 | return; | |
841 | } | |
842 | ||
f0e81ffe | 843 | notify("Saving label..."); |
dbd9e2f1 | 844 | |
48f0adb0 AD |
845 | active_label = false; |
846 | ||
847 | xmlhttp.open("GET", "backend.php?op=pref-labels&subop=editSave&id=" + | |
848 | label + "&s=" + param_escape(sqlexp) + "&d=" + param_escape(descr), | |
849 | true); | |
850 | ||
851 | xmlhttp.onreadystatechange=labellist_callback; | |
852 | xmlhttp.send(null); | |
853 | ||
854 | } | |
855 | ||
e6cb77a0 AD |
856 | function userEditSave() { |
857 | ||
858 | var user = active_user; | |
859 | ||
860 | if (!xmlhttp_ready(xmlhttp)) { | |
861 | printLockingError(); | |
862 | return | |
863 | } | |
864 | ||
865 | var login = document.getElementById("iedit_ulogin").value; | |
866 | var level = document.getElementById("iedit_ulevel").value; | |
867 | ||
868 | if (login.length == 0) { | |
869 | notify("Login cannot be blank."); | |
870 | return; | |
871 | } | |
872 | ||
873 | if (level.length == 0) { | |
874 | notify("User level cannot be blank."); | |
875 | return; | |
876 | } | |
877 | ||
878 | active_user = false; | |
879 | ||
f0e81ffe | 880 | notify("Saving user..."); |
dbd9e2f1 | 881 | |
e6cb77a0 AD |
882 | xmlhttp.open("GET", "backend.php?op=pref-users&subop=editSave&id=" + |
883 | user + "&l=" + param_escape(login) + "&al=" + param_escape(level), | |
884 | true); | |
885 | ||
dbd9e2f1 | 886 | xmlhttp.onreadystatechange=userlist_callback; |
e6cb77a0 AD |
887 | xmlhttp.send(null); |
888 | ||
889 | } | |
890 | ||
891 | ||
a0d53889 AD |
892 | function filterEditSave() { |
893 | ||
894 | var filter = active_filter; | |
895 | ||
896 | if (!xmlhttp_ready(xmlhttp)) { | |
897 | printLockingError(); | |
898 | return | |
899 | } | |
900 | ||
901 | var regexp = document.getElementById("iedit_regexp").value; | |
902 | var descr = document.getElementById("iedit_descr").value; | |
25cb5736 | 903 | var match = document.getElementById("iedit_match"); |
19c9cb11 | 904 | |
25cb5736 | 905 | var v_match = match[match.selectedIndex].text; |
a0d53889 | 906 | |
ead60402 AD |
907 | var feed = document.getElementById("iedit_feed"); |
908 | var feed_id = feed[feed.selectedIndex].id; | |
909 | ||
19c9cb11 AD |
910 | var action = document.getElementById("iedit_filter_action"); |
911 | var action_id = action[action.selectedIndex].id; | |
912 | ||
a0d53889 AD |
913 | // notify("Saving filter " + filter + ": " + regexp + ", " + descr + ", " + match); |
914 | ||
915 | if (regexp.length == 0) { | |
916 | notify("Filter expression cannot be blank."); | |
917 | return; | |
918 | } | |
919 | ||
920 | active_filter = false; | |
921 | ||
922 | xmlhttp.open("GET", "backend.php?op=pref-filters&subop=editSave&id=" + | |
923 | filter + "&r=" + param_escape(regexp) + "&d=" + param_escape(descr) + | |
19c9cb11 AD |
924 | "&m=" + param_escape(v_match) + "&fid=" + param_escape(feed_id) + |
925 | "&aid=" + param_escape(action_id), true); | |
dbd9e2f1 | 926 | |
f0e81ffe | 927 | notify("Saving filter..."); |
dbd9e2f1 | 928 | |
a0d53889 AD |
929 | xmlhttp.onreadystatechange=filterlist_callback; |
930 | xmlhttp.send(null); | |
931 | ||
932 | } | |
933 | ||
48f0adb0 AD |
934 | function editSelectedLabel() { |
935 | var rows = getSelectedLabels(); | |
a0d53889 | 936 | |
48f0adb0 AD |
937 | if (rows.length == 0) { |
938 | notify("No labels are selected."); | |
939 | return; | |
a0d53889 AD |
940 | } |
941 | ||
48f0adb0 AD |
942 | if (rows.length > 1) { |
943 | notify("Please select one label."); | |
944 | return; | |
945 | } | |
a0d53889 | 946 | |
dbd9e2f1 AD |
947 | notify(""); |
948 | ||
48f0adb0 | 949 | editLabel(rows[0]); |
a0d53889 | 950 | |
a0d53889 AD |
951 | } |
952 | ||
e6cb77a0 AD |
953 | function editSelectedUser() { |
954 | var rows = getSelectedUsers(); | |
955 | ||
956 | if (rows.length == 0) { | |
957 | notify("No users are selected."); | |
958 | return; | |
959 | } | |
960 | ||
961 | if (rows.length > 1) { | |
962 | notify("Please select one user."); | |
963 | return; | |
964 | } | |
965 | ||
dbd9e2f1 AD |
966 | notify(""); |
967 | ||
e6cb77a0 AD |
968 | editUser(rows[0]); |
969 | } | |
970 | ||
971 | function resetSelectedUserPass() { | |
972 | var rows = getSelectedUsers(); | |
973 | ||
974 | if (rows.length == 0) { | |
975 | notify("No users are selected."); | |
976 | return; | |
977 | } | |
978 | ||
979 | if (rows.length > 1) { | |
980 | notify("Please select one user."); | |
981 | return; | |
982 | } | |
983 | ||
69668465 | 984 | var ok = confirm("Reset password of selected user?"); |
e6cb77a0 | 985 | |
69668465 AD |
986 | if (ok) { |
987 | notify("Resetting password for selected user..."); | |
988 | ||
989 | var id = rows[0]; | |
990 | ||
991 | xmlhttp.open("GET", "backend.php?op=pref-users&subop=resetPass&id=" + | |
992 | param_escape(id), true); | |
993 | xmlhttp.onreadystatechange=userlist_callback; | |
994 | xmlhttp.send(null); | |
995 | } | |
e6cb77a0 AD |
996 | } |
997 | ||
717f5e64 | 998 | function selectedUserDetails() { |
e6cb77a0 | 999 | |
1a7572cb AD |
1000 | if (!xmlhttp_ready(xmlhttp)) { |
1001 | printLockingError(); | |
1002 | return | |
1003 | } | |
1004 | ||
717f5e64 AD |
1005 | var rows = getSelectedUsers(); |
1006 | ||
1007 | if (rows.length == 0) { | |
1008 | notify("No users are selected."); | |
1009 | return; | |
1010 | } | |
1011 | ||
1012 | if (rows.length > 1) { | |
1013 | notify("Please select one user."); | |
1014 | return; | |
1015 | } | |
1016 | ||
1017 | var id = rows[0]; | |
1018 | ||
dbd9e2f1 AD |
1019 | notify(""); |
1020 | ||
1a7572cb | 1021 | xmlhttp.open("GET", "backend.php?op=user-details&id=" + id, true); |
c6c3a07f AD |
1022 | xmlhttp.onreadystatechange=infobox_callback; |
1023 | xmlhttp.send(null); | |
1024 | ||
1025 | } | |
1026 | ||
1027 | function selectedFeedDetails() { | |
1028 | ||
1029 | if (!xmlhttp_ready(xmlhttp)) { | |
1030 | printLockingError(); | |
1031 | return | |
1032 | } | |
1033 | ||
1034 | var rows = getSelectedFeeds(); | |
1035 | ||
1036 | if (rows.length == 0) { | |
1037 | notify("No feeds are selected."); | |
1038 | return; | |
1039 | } | |
1040 | ||
df268d47 AD |
1041 | // if (rows.length > 1) { |
1042 | // notify("Please select one feed."); | |
1043 | // return; | |
1044 | // } | |
c6c3a07f | 1045 | |
df268d47 | 1046 | // var id = rows[0]; |
c6c3a07f | 1047 | |
dbd9e2f1 AD |
1048 | notify(""); |
1049 | ||
df268d47 AD |
1050 | xmlhttp.open("GET", "backend.php?op=feed-details&id=" + |
1051 | param_escape(rows.toString()), true); | |
c6c3a07f | 1052 | xmlhttp.onreadystatechange=infobox_callback; |
1a7572cb | 1053 | xmlhttp.send(null); |
717f5e64 AD |
1054 | |
1055 | } | |
a0d53889 AD |
1056 | |
1057 | function editSelectedFilter() { | |
1058 | var rows = getSelectedFilters(); | |
1059 | ||
1060 | if (rows.length == 0) { | |
1061 | notify("No filters are selected."); | |
1062 | return; | |
1063 | } | |
1064 | ||
1065 | if (rows.length > 1) { | |
1066 | notify("Please select one filter."); | |
1067 | return; | |
1068 | } | |
1069 | ||
dbd9e2f1 AD |
1070 | notify(""); |
1071 | ||
a0d53889 AD |
1072 | editFilter(rows[0]); |
1073 | ||
1074 | } | |
1075 | ||
1076 | ||
508a81e1 AD |
1077 | function editSelectedFeed() { |
1078 | var rows = getSelectedFeeds(); | |
1079 | ||
1080 | if (rows.length == 0) { | |
1081 | notify("No feeds are selected."); | |
1082 | return; | |
1083 | } | |
1084 | ||
1085 | if (rows.length > 1) { | |
1086 | notify("Please select one feed."); | |
1087 | return; | |
1088 | } | |
1089 | ||
dbd9e2f1 AD |
1090 | notify(""); |
1091 | ||
508a81e1 | 1092 | editFeed(rows[0]); |
91ff844a AD |
1093 | |
1094 | } | |
1095 | ||
1096 | function editSelectedFeedCat() { | |
1097 | var rows = getSelectedFeedCats(); | |
1098 | ||
1099 | if (rows.length == 0) { | |
1100 | notify("No categories are selected."); | |
1101 | return; | |
1102 | } | |
1103 | ||
1104 | if (rows.length > 1) { | |
1105 | notify("Please select one category."); | |
1106 | return; | |
1107 | } | |
1108 | ||
1109 | notify(""); | |
1110 | ||
1111 | editFeedCat(rows[0]); | |
508a81e1 AD |
1112 | |
1113 | } | |
1114 | ||
13ad9102 AD |
1115 | function localPiggieFunction(enable) { |
1116 | if (enable) { | |
508a81e1 AD |
1117 | piggie.style.display = "block"; |
1118 | seq = ""; | |
1119 | notify("I loveded it!!!"); | |
1120 | } else { | |
1121 | piggie.style.display = "none"; | |
1122 | notify(""); | |
1123 | } | |
508a81e1 AD |
1124 | } |
1125 | ||
9f311df6 AD |
1126 | function validateOpmlImport() { |
1127 | ||
1128 | var opml_file = document.getElementById("opml_file"); | |
1129 | ||
1130 | if (opml_file.value.length == 0) { | |
1131 | notify("Please select OPML file to upload."); | |
1132 | return false; | |
1133 | } else { | |
1134 | return true; | |
1135 | } | |
1136 | } | |
1137 | ||
a0d53889 AD |
1138 | function updateFilterList() { |
1139 | ||
1140 | if (!xmlhttp_ready(xmlhttp)) { | |
1141 | printLockingError(); | |
1142 | return | |
1143 | } | |
1144 | ||
f5a50b25 AD |
1145 | // document.getElementById("prefContent").innerHTML = "Loading filters, please wait..."; |
1146 | ||
1147 | p_notify("Loading, please wait..."); | |
a0d53889 AD |
1148 | |
1149 | xmlhttp.open("GET", "backend.php?op=pref-filters", true); | |
1150 | xmlhttp.onreadystatechange=filterlist_callback; | |
1151 | xmlhttp.send(null); | |
1152 | ||
1153 | } | |
1154 | ||
48f0adb0 AD |
1155 | function updateLabelList() { |
1156 | ||
1157 | if (!xmlhttp_ready(xmlhttp)) { | |
1158 | printLockingError(); | |
1159 | return | |
1160 | } | |
1161 | ||
f5a50b25 AD |
1162 | p_notify("Loading, please wait..."); |
1163 | ||
1164 | // document.getElementById("prefContent").innerHTML = "Loading labels, please wait..."; | |
48f0adb0 AD |
1165 | |
1166 | xmlhttp.open("GET", "backend.php?op=pref-labels", true); | |
1167 | xmlhttp.onreadystatechange=labellist_callback; | |
1168 | xmlhttp.send(null); | |
48f0adb0 AD |
1169 | } |
1170 | ||
4255b24c AD |
1171 | function updatePrefsList() { |
1172 | ||
1173 | if (!xmlhttp_ready(xmlhttp)) { | |
1174 | printLockingError(); | |
1175 | return | |
1176 | } | |
1177 | ||
1178 | p_notify("Loading, please wait..."); | |
1179 | ||
1180 | xmlhttp.open("GET", "backend.php?op=pref-prefs", true); | |
1181 | xmlhttp.onreadystatechange=prefslist_callback; | |
1182 | xmlhttp.send(null); | |
1183 | ||
1184 | } | |
1185 | ||
f5a50b25 | 1186 | function selectTab(id) { |
48f0adb0 | 1187 | |
c6c3a07f AD |
1188 | if (!xmlhttp_ready(xmlhttp)) { |
1189 | printLockingError(); | |
1190 | return | |
1191 | } | |
1192 | ||
f5a50b25 | 1193 | if (id == "feedConfig") { |
a0d53889 | 1194 | updateFeedList(); |
f5a50b25 | 1195 | } else if (id == "filterConfig") { |
a0d53889 | 1196 | updateFilterList(); |
f5a50b25 | 1197 | } else if (id == "labelConfig") { |
48f0adb0 | 1198 | updateLabelList(); |
4255b24c AD |
1199 | } else if (id == "genConfig") { |
1200 | updatePrefsList(); | |
e6cb77a0 AD |
1201 | } else if (id == "userConfig") { |
1202 | updateUsersList(); | |
a0d53889 | 1203 | } |
f5a50b25 AD |
1204 | |
1205 | var tab = document.getElementById(active_tab + "Tab"); | |
1206 | ||
1207 | if (tab) { | |
1208 | if (tab.className.match("Selected")) { | |
1209 | tab.className = "prefsTab"; | |
1210 | } | |
1211 | } | |
1212 | ||
1213 | tab = document.getElementById(id + "Tab"); | |
1214 | ||
1215 | if (tab) { | |
1216 | if (!tab.className.match("Selected")) { | |
1217 | tab.className = tab.className + "Selected"; | |
1218 | } | |
1219 | } | |
1220 | ||
1221 | active_tab = id; | |
1222 | ||
4da47970 AD |
1223 | setCookie('ttrss_pref_acttab', active_tab); |
1224 | ||
a0d53889 AD |
1225 | } |
1226 | ||
007bda35 | 1227 | function init() { |
e2ec66a8 | 1228 | |
7719618b AD |
1229 | try { |
1230 | ||
1231 | // IE kludge | |
1232 | if (!xmlhttp) { | |
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."; | |
1236 | return; | |
1237 | } | |
4da47970 AD |
1238 | |
1239 | active_tab = getCookie("ttrss_pref_acttab"); | |
1240 | if (!active_tab) active_tab = "genConfig"; | |
1241 | selectTab(active_tab); | |
7719618b AD |
1242 | |
1243 | document.onkeydown = hotkey_handler; | |
1244 | notify(""); | |
1245 | } catch (e) { | |
1246 | exception_error("init", e); | |
e2ec66a8 | 1247 | } |
007bda35 | 1248 | } |
b1895692 | 1249 | |
c6c3a07f | 1250 | function closeInfoBox() { |
2317ffaa AD |
1251 | var box = document.getElementById('infoBox'); |
1252 | var shadow = document.getElementById('infoBoxShadow'); | |
1253 | ||
1254 | if (shadow) { | |
1255 | shadow.style.display = "none"; | |
1256 | } else if (box) { | |
1257 | box.style.display = "none"; | |
1258 | } | |
1a7572cb | 1259 | } |
f932bc9f AD |
1260 | |
1261 | function categorizeSelectedFeeds() { | |
1262 | ||
1263 | if (!xmlhttp_ready(xmlhttp)) { | |
1264 | printLockingError(); | |
1265 | return | |
1266 | } | |
1267 | ||
1268 | var sel_rows = getSelectedFeeds(); | |
1269 | ||
1270 | var cat_sel = document.getElementById("sfeed_set_fcat"); | |
1271 | var cat_id = cat_sel[cat_sel.selectedIndex].id; | |
1272 | ||
1273 | if (sel_rows.length > 0) { | |
1274 | ||
1275 | notify("Changing category of selected feeds..."); | |
1276 | ||
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; | |
1280 | xmlhttp.send(null); | |
1281 | ||
1282 | } else { | |
1283 | ||
1284 | notify("Please select some feeds first."); | |
1285 | ||
1286 | } | |
1287 | ||
1288 | } | |
69668465 AD |
1289 | |
1290 | function validatePrefsReset() { | |
1291 | return confirm("Reset to defaults?"); | |
1292 | } |