]> git.wh0rd.org - tt-rss.git/commitdiff
use Ajax.getTransport to create our xmlhttp objects
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 20 May 2006 13:01:11 +0000 (14:01 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 20 May 2006 13:01:11 +0000 (14:01 +0100)
functions.js
prefs.js
tt-rss.js
tt-rss.php

index 683d80077641807871850558f4fd0b9c949f64d3..209ca340ad540d8de0e54b79a5fb4dced2e85edf 100644 (file)
@@ -404,26 +404,7 @@ function setActiveFeedId(id) {
        return setCookie("ttrss_vf_actfeed", id);
 }
 
-var xmlhttp_rpc = false;
-
-/*@cc_on @*/
-/*@if (@_jscript_version >= 5)
-// JScript gives us Conditional compilation, we can cope with old IE versions.
-// and security blocked creation of the objects.
-try {
-       xmlhttp_rpc = new ActiveXObject("Msxml2.XMLHTTP");
-} catch (e) {
-       try {
-               xmlhttp_rpc = new ActiveXObject("Microsoft.XMLHTTP");
-       } catch (E) {
-               xmlhttp_rpc = false;
-       }
-}
-@end @*/
-
-if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') {
-       xmlhttp_rpc = new XMLHttpRequest();
-}
+var xmlhttp_rpc = Ajax.getTransport();
 
 function parse_counters(reply, f_document, title_obj, scheduled_call) {
        try {
@@ -937,27 +918,6 @@ function leading_zero(p) {
        return s;
 }
 
-function center_element(e) {
-
-       try {
-               var c_width = document.body.clientWidth;
-               var c_height = document.body.clientHeight;
-       
-               var c_scroll = document.body.scrollTop;
-       
-               var e_width = e.clientWidth;
-               var e_height = e.clientHeight;
-       
-               var set_y = (c_height / 2) + c_scroll - (e_height / 2);
-               var set_x = (c_width / 2) - (e_width / 2);
-       
-               e.style.top = set_y + "px";
-               e.style.left = set_x + "px";
-       } catch (e) {
-               exception_error("center_element", e);
-       }
-}
-
 function closeInfoBox() {
        var box = document.getElementById('infoBox');
        var shadow = document.getElementById('infoBoxShadow');
index c98dbcc8d20bee61e5b59f5647e545782d8bfa3c..23830cee74cb8a853bb75b46a44d23b5a8c96e6f 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -11,24 +11,7 @@ var feed_to_expand = false;
 var piggie_top = -400;
 var piggie_fwd = true;
 
-/*@cc_on @*/
-/*@if (@_jscript_version >= 5)
-// JScript gives us Conditional compilation, we can cope with old IE versions.
-// and security blocked creation of the objects.
-try {
-       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
-} catch (e) {
-       try {
-               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
-       } catch (E) {
-               xmlhttp = false;
-       }
-}
-@end @*/
-
-if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
-       xmlhttp = new XMLHttpRequest();
-}
+var xmlhttp = Ajax.getTransport();
 
 function expand_feed_callback() {
        if (xmlhttp.readyState == 4) {
@@ -476,38 +459,6 @@ function getSelectedFeedsFromBrowser() {
        return selected;
 }
 
-
-/*function readSelectedFeeds(read) {
-
-       if (!xmlhttp_ready(xmlhttp)) {
-               printLockingError();
-               return
-       }
-
-       var sel_rows = getSelectedFeeds();
-
-       if (sel_rows.length > 0) {
-
-               if (!read) {
-                       op = "unread";
-               } else {
-                       op = "read";
-               }
-
-               notify("Marking selected feeds as " + op + "...");
-
-               xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=" + op + "&ids="+
-                       param_escape(sel_rows.toString()), true);
-               xmlhttp.onreadystatechange=notify_callback;
-               xmlhttp.send(null);
-
-       } else {
-
-               alert("No feeds are selected.");
-
-       }
-} */
-
 function removeSelectedLabels() {
 
        if (!xmlhttp_ready(xmlhttp)) {
@@ -719,8 +670,6 @@ function feedCatEditSave() {
 
        notify("Saving category...");
 
-//     var cat_title = document.getElementById("iedit_title").value;
-
        var query = Form.serialize("feed_cat_edit_form");
 
        xmlhttp.open("GET", "backend.php?" + query, true);
index 6a31714692c48edda576153966b80ac39247dff3..99afd7d6e4787b9de5353bebec8ad6cc71411874 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -11,24 +11,7 @@ var firsttime_update = true;
 var last_refetch = 0;
 var cookie_lifetime = 0;
 
-/*@cc_on @*/
-/*@if (@_jscript_version >= 5)
-// JScript gives us Conditional compilation, we can cope with old IE versions.
-// and security blocked creation of the objects.
-try {
-       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
-} catch (e) {
-       try {
-               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
-       } catch (E) {
-               xmlhttp = false;
-       }
-}
-@end @*/
-
-if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
-       xmlhttp = new XMLHttpRequest();
-}
+var xmlhttp = Ajax.getTransport();
 
 function toggleTags() {
        display_tags = !display_tags;
index d0a31f6bba65bdacfeda5e9383e45ca2b226a596..8f7c1d4762ca93d86d2b40e862999d89ed64d7b2 100644 (file)
@@ -44,6 +44,8 @@
 
        <? } ?>
 
+       <script type="text/javascript" src="prototype.js"></script>
+
        <script type="text/javascript" src="tt-rss.js?<?= $dt_add ?>"></script>
        <script type="text/javascript" src="functions.js?<?= $dt_add ?>"></script>
        <!--[if gte IE 5.5000]>