| 54 | | this.name = doc.getElementsByTagName("title")[0].firstChild.nodeValue; |
|---|
| 55 | | var itemlist = doc.getElementsByTagName('item'); |
|---|
| | 54 | this.name = doc.getElementsByTagNameNS('*', 'title')[0].firstChild.nodeValue; |
|---|
| | 55 | |
|---|
| | 56 | /* Try RSS items first, then Atom entries */ |
|---|
| | 57 | var itemlist = doc.getElementsByTagNameNS('*', 'item'); |
|---|
| | 58 | if (itemlist.length == 0) { |
|---|
| | 59 | itemlist = doc.getElementsByTagNameNS('*', 'entry'); |
|---|
| | 60 | } |
|---|
| | 61 | |
|---|
| 80 | | catch (e) { alert(e); } |
|---|
| 81 | | |
|---|
| 82 | | var description = "No description"; |
|---|
| | 86 | catch (e) { title="Untitled"; } |
|---|
| | 87 | |
|---|
| | 88 | /* First try RSS descriptions, then Atom summaries */ |
|---|
| | 89 | var descr_nodes = itemlist[i].getElementsByTagNameNS("*", |
|---|
| | 90 | "description"); |
|---|
| | 91 | if (descr_nodes.length == 0) { |
|---|
| | 92 | descr_nodes = itemlist[i].getElementsByTagNameNS("*","summary"); |
|---|
| | 93 | } |
|---|
| | 94 | |
|---|
| | 95 | var description = "No description."; |
|---|
| 93 | | contentHTML = "<br />"; |
|---|
| 94 | | contentHTML += "<div style='margin: -0.5em 0.5em 0.5em 0.5em'>" |
|---|
| 95 | | |
|---|
| 96 | | contentHTML += "<div style='height: 1.3em; overflow: hidden'>"; |
|---|
| 97 | | contentHTML += "<span style='font-size: 1.2em; font-weight: bold'>"; |
|---|
| 98 | | if (link) contentHTML += "<a href='"+link+"' target='_blank'>"; |
|---|
| 99 | | contentHTML += title; |
|---|
| 100 | | if (link) contentHTML += "</a>"; |
|---|
| 101 | | contentHTML += "</span>"; |
|---|
| 102 | | contentHTML += "</div>"; |
|---|
| 103 | | |
|---|
| 104 | | |
|---|
| 105 | | contentHTML += "<span style='font-size: 0.7em; align:center'>"; |
|---|
| 106 | | contentHTML += description; |
|---|
| 107 | | contentHTML += "</span>"; |
|---|
| 108 | | |
|---|
| 109 | | contentHTML += "</div>" |
|---|
| 110 | | data['popupContentHTML'] = contentHTML; |
|---|
| 111 | | |
|---|
| 112 | | //data['popupContentHTML'] = '<h2>'+title+'</h2><p>'+description+'</p>'; |
|---|
| | 105 | contentHTML = '<div style="float:left;font-size:120%;">'; |
|---|
| | 106 | if (link) contentHTML += '<a class="link" href="'+link+'" target="_blank">'; |
|---|
| | 107 | contentHTML += title; |
|---|
| | 108 | if (link) contentHTML += '</a>'; |
|---|
| | 109 | contentHTML += '</div>'; |
|---|
| | 110 | contentHTML += '<div style="float:right;color:gray;font-size:120%;font-family:sans-serif">[x]</div>'; |
|---|
| | 111 | contentHTML += '<div style="float:left;width:100%;overflow:auto;font-size:100%;">'; |
|---|
| | 112 | contentHTML += description; |
|---|
| | 113 | contentHTML += '</div>'; |
|---|
| | 114 | data['popupContentHTML'] = contentHTML; |
|---|