]> git.wh0rd.org - tt-rss.git/blame - prefs.js
initial prefpane work
[tt-rss.git] / prefs.js
CommitLineData
007bda35
AD
1/*
2 This program is Copyright (c) 2003-2005 Andrew Dolgov <cthulhoo@gmail.com>
3 Licensed under GPL v.2 or (at your preference) any later version.
4*/
5
6var xmlhttp = false;
7
8/*@cc_on @*/
9/*@if (@_jscript_version >= 5)
10// JScript gives us Conditional compilation, we can cope with old IE versions.
11// and security blocked creation of the objects.
12try {
13 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
14} catch (e) {
15 try {
16 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
17 } catch (E) {
18 xmlhttp = false;
19 }
20}
21@end @*/
22
23if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
24 xmlhttp = new XMLHttpRequest();
25}
26
27function param_escape(arg) {
28 if (typeof encodeURIComponent != 'undefined')
29 return encodeURIComponent(arg);
30 else
31 return escape(arg);
32}
33
34function param_unescape(arg) {
35 if (typeof decodeURIComponent != 'undefined')
36 return decodeURIComponent(arg);
37 else
38 return unescape(arg);
39}
40
41function notify(msg) {
42
43 var n = document.getElementById("notify");
44
45 n.innerHTML = msg;
46
47}
48
49function feedlist_callback() {
50 var container = document.getElementById('feeds');
51 if (xmlhttp.readyState == 4) {
52 container.innerHTML=xmlhttp.responseText;
53 }
54}
55
56function update_feeds() {
57
58 document.getElementById("feeds").innerHTML = "Loading feeds, please wait...";
59
60 xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
61 xmlhttp.onreadystatechange=feedlist_callback;
62 xmlhttp.send(null);
63
64}
65
66function toggleSelectRow(sender) {
67 var parent_row = sender.parentNode.parentNode;
68
69 if (sender.checked) {
70 if (!parent_row.className.match("Selected")) {
71 parent_row.className = parent_row.className + "Selected";
72 }
73 } else {
74 if (parent_row.className.match("Selected")) {
75 parent_row.className = parent_row.className.replace("Selected", "");
76 }
77 }
78}
79
80
81function init() {
82
83 notify("init");
84
85 update_feeds();
86
87}