]>
git.wh0rd.org - tt-rss.git/blob - tt-rss.js
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.
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.
13 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
16 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
23 if (!xmlhttp
&& typeof XMLHttpRequest
!='undefined') {
24 xmlhttp
= new XMLHttpRequest();
27 function param_escape(arg
) {
28 if (typeof encodeURIComponent
!= 'undefined')
29 return encodeURIComponent(arg
);
34 function param_unescape(arg
) {
35 if (typeof decodeURIComponent
!= 'undefined')
36 return decodeURIComponent(arg
);
41 function notify(msg
) {
43 var n
= document
.getElementById("notify");
49 function feedlist_callback() {
50 if (xmlhttp
.readyState
== 4) {
51 document
.getElementById('feeds').innerHTML
=xmlhttp
.responseText
;
55 function viewfeed_callback() {
56 if (xmlhttp
.readyState
== 4) {
57 document
.getElementById('headlines').innerHTML
=xmlhttp
.responseText
;
61 function view_callback() {
62 if (xmlhttp
.readyState
== 4) {
63 document
.getElementById('content').innerHTML
=xmlhttp
.responseText
;
68 function update_feed_list() {
70 xmlhttp
.open("GET", "backend.php?op=feeds", true);
71 xmlhttp
.onreadystatechange
=feedlist_callback
;
76 function viewfeed(feed
) {
78 notify("view-feed: " + feed
);
80 xmlhttp
.open("GET", "backend.php?op=viewfeed&feed=" + param_escape(feed
) , true);
81 xmlhttp
.onreadystatechange
=viewfeed_callback
;
86 function view(feed
, post
) {
88 notify("view: " + feed
+ ", " + post
);
90 xmlhttp
.open("GET", "backend.php?op=view&feed=" + param_escape(feed
) +
91 "&post=" + post
, true);
92 xmlhttp
.onreadystatechange
=view_callback
;