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

getArticleLink: add escaping; open_article_in_new_window: add error notifications (closes #202)

This commit is contained in:
Andrew Dolgov
2008-04-18 06:13:00 +01:00
parent ae56f76274
commit 06925d9e85
2 changed files with 10 additions and 1 deletions

View File

@@ -68,10 +68,15 @@ function open_article_callback(transport) {
try {
if (transport.responseXML) {
var link = transport.responseXML.getElementsByTagName("link")[0];
var id = transport.responseXML.getElementsByTagName("id")[0];
debug("open_article_callback, received link: " + link);
if (link) {
debug("link url: " + link.firstChild.nodeValue);
window.open(link.firstChild.nodeValue, "_blank");
if (id) {
@@ -80,7 +85,11 @@ function open_article_callback(transport) {
window.setTimeout("toggleUnread(" + id + ", 0)", 100);
}
}
} else {
notify_error("Can't open article: received invalid article link");
}
} else {
notify_error("Can't open article: received invalid XML");
}
} catch (e) {