1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-18 14:31:30 +00:00

use Ajax.getTransport to create our xmlhttp objects

This commit is contained in:
Andrew Dolgov
2006-05-20 14:01:11 +01:00
parent 0666e120e8
commit a58069db8a
4 changed files with 5 additions and 111 deletions

View File

@@ -404,26 +404,7 @@ function setActiveFeedId(id) {
return setCookie("ttrss_vf_actfeed", id); return setCookie("ttrss_vf_actfeed", id);
} }
var xmlhttp_rpc = false; var xmlhttp_rpc = Ajax.getTransport();
/*@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();
}
function parse_counters(reply, f_document, title_obj, scheduled_call) { function parse_counters(reply, f_document, title_obj, scheduled_call) {
try { try {
@@ -937,27 +918,6 @@ function leading_zero(p) {
return s; 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() { function closeInfoBox() {
var box = document.getElementById('infoBox'); var box = document.getElementById('infoBox');
var shadow = document.getElementById('infoBoxShadow'); var shadow = document.getElementById('infoBoxShadow');

View File

@@ -11,24 +11,7 @@ var feed_to_expand = false;
var piggie_top = -400; var piggie_top = -400;
var piggie_fwd = true; var piggie_fwd = true;
/*@cc_on @*/ var xmlhttp = Ajax.getTransport();
/*@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();
}
function expand_feed_callback() { function expand_feed_callback() {
if (xmlhttp.readyState == 4) { if (xmlhttp.readyState == 4) {
@@ -476,38 +459,6 @@ function getSelectedFeedsFromBrowser() {
return selected; 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() { function removeSelectedLabels() {
if (!xmlhttp_ready(xmlhttp)) { if (!xmlhttp_ready(xmlhttp)) {
@@ -719,8 +670,6 @@ function feedCatEditSave() {
notify("Saving category..."); notify("Saving category...");
// var cat_title = document.getElementById("iedit_title").value;
var query = Form.serialize("feed_cat_edit_form"); var query = Form.serialize("feed_cat_edit_form");
xmlhttp.open("GET", "backend.php?" + query, true); xmlhttp.open("GET", "backend.php?" + query, true);

View File

@@ -11,24 +11,7 @@ var firsttime_update = true;
var last_refetch = 0; var last_refetch = 0;
var cookie_lifetime = 0; var cookie_lifetime = 0;
/*@cc_on @*/ var xmlhttp = Ajax.getTransport();
/*@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();
}
function toggleTags() { function toggleTags() {
display_tags = !display_tags; display_tags = !display_tags;

View 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="tt-rss.js?<?= $dt_add ?>"></script>
<script type="text/javascript" src="functions.js?<?= $dt_add ?>"></script> <script type="text/javascript" src="functions.js?<?= $dt_add ?>"></script>
<!--[if gte IE 5.5000]> <!--[if gte IE 5.5000]>