1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 05:15:56 +00:00

implement ajax loading of cdm content when not in expand mode

This commit is contained in:
Andrew Dolgov
2010-11-13 02:09:30 +03:00
parent 62b800b47c
commit dd1c068056
3 changed files with 58 additions and 6 deletions

View File

@@ -2001,8 +2001,33 @@ function cdmExpandArticle(id) {
elem = $("CICD-" + id);
if (!Element.visible(elem)) {
$("FUPDPIC-" + id).src = "images/indicator_tiny.gif";
$("CWRAP-" + id).innerHTML = "<div class=\"insensitive\">" +
__("Loading, please wait...") + "</div>";
Element.show(elem);
Element.hide("CEXC-" + id);
var query = "?op=rpc&subop=cdmGetArticle&id=" + param_escape(id);
//console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
$("FUPDPIC-" + id).src = 'images/blank_icon.gif';
if (transport.responseXML) {
var article = transport.responseXML.getElementsByTagName("article")[0];
var recv_id = article.getAttribute("id");
if (recv_id == id)
$("CWRAP-" + id).innerHTML = article.firstChild.nodeValue;
} else {
$("CWRAP-" + id).innerHTML = __("Unable to load article.");
}
}});
}
var new_offset = $("RROW-" + id).offsetTop;