Ticket #10195: feed.html

File feed.html, 40.0 KB (added by dsjonny, 11 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <meta http-equiv='content-type' content='text/html; charset=utf-8'/>
5 <link rel='shortcut icon' href='http://www.haiku-os.org/sites/haiku-os.org/themes/current/favicon.ico' type='image/x-icon'/>
6 <link rel='bookmark icon' href='http://www.haiku-os.org/sites/haiku-os.org/themes/current/favicon.ico' type='image/x-icon'/>
7 <title>Haiku feed viewer</title>
8 <style type='text/css'>
9 html {
10 margin: 0;
11 padding: 0;
12 background: #FFF;
13 }
14
15 body {
16 color: #333333;
17 line-height: 1.5;
18 margin: 0;
19 padding: 0;
20 font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
21 }
22
23 a:link, span.markread {
24 font-weight: bold;
25 text-decoration: none;
26 color: #dc3c01;
27 }
28
29 a:visited {
30 font-weight: bold;
31 text-decoration: none;
32 color: #892601;
33 }
34
35 a:hover, a:active {
36 text-decoration: underline;
37 color: #ff4500;
38 }
39
40 p {
41 text-align: justify;
42 }
43
44 h2 {
45 font-size: 1.3em;
46 font-weight: normal;
47 color: #0c3762;
48 border-bottom: solid thin #e0e0e0;
49 margin-top: 35px;
50 }
51
52 h2 a:hover {
53 text-decoration: none;
54 color: #0c3762;
55 }
56
57 pre {
58 border-color: #0c3762;
59 border-style: dotted;
60 border-width: thin;
61 margin: 0em;
62 padding: 1.5em;
63 background-color: #f0f0f0;
64 white-space: pre-wrap;
65 word-wrap: break-word;
66 }
67
68 #banner {
69 position: relative;
70 left: 0;
71 top: 0;
72 height: 84px;
73 min-width: 59em;
74 background: #eeeeee;
75 background-position: right center;
76 background-repeat: no-repeat;
77 }
78
79 #banner div {
80 min-width: 59em;
81 max-width: 70em;
82 margin: 0 auto;
83 white-space: pre-wrap;
84 word-wrap: break-word;
85 padding: 5px;
86 font-size: 0.8em;
87 font-style: italic;
88 }
89
90 #feedtitle {
91 position: absolute;
92 bottom: 10px;
93 left: 200px;
94 color: #333333;
95 text-transform: uppercase;
96 letter-spacing: 3px;
97 font-family: Myriad Pro,Myriad Web Pro Regular,Lucida Grande,Geneva,Trebuchet MS,sans-serif;
98 font-weight: normal;
99 font-size: 16px;
100 }
101
102 #bannerbar {
103 position: relative;
104 min-width: 59em;
105 left: 0;
106 top: 0;
107 background: #e0e0e0;
108 height: 100%;
109 margin: 0 auto;
110 padding: 0;
111 font-size: 0.8em;
112 }
113
114 #bannerbar span {
115 padding-left: 5px;
116 padding-right: 5px;
117 }
118
119 #bannerbar span:hover {
120 text-decoration: underline;
121 color: #0c3762;
122 }
123
124 #feedcategory, #feedinfos, #feedpreferences, div.itemcategory {
125 background-color: #e4ffde;
126 margin-top: 10px;
127 padding: 5px;
128 font-size: 0.8em;
129 border: thin dotted #dcdcdc;
130 }
131
132 #feedcategory span, div.iteminfo a, div.itemcategory span, div.group a {
133 margin-right: 10px;
134 cursor: pointer;
135 }
136
137 div.group span {
138 padding-right: 10px;
139 }
140
141 div.iteminfo, div.group {
142 padding: 5px;
143 padding-left: 20px;
144 }
145
146 div.iteminfo span {
147 margin-right: 10px;
148 }
149
150 span.itemlink:hover, div.itemcategory span:hover, #feedcategory span:hover {
151 text-decoration: underline;
152 color: #0c3762;
153 cursor: pointer;
154 }
155
156 p.description {
157 padding: 5px;
158 border: thin dotted #dcdcdc;
159 }
160
161 #content {
162 min-width: 59em;
163 max-width: 70em;
164 margin: 0 auto;
165 }
166
167 #page div {
168 font-size: 0.9em;
169 }
170
171 a.totop, span.markread {
172 float: right;
173 font-size: 0.6em;
174 margin-top: 10px;
175 padding-left: 10px;
176 cursor: pointer;
177 }
178
179 fieldset {
180 border: none;
181 }
182
183 legend {
184 font-weight: bold;
185 }
186 </style>
187 <script type='text/javascript'>
188 <!--
189 var language = window.navigator.userLanguage || window.navigator.language;
190 var feed = "";
191 var interval;
192 var i = 0;
193 var imax = (15 * 60);
194 var lastread = new Date();
195 lastread.setFullYear(2000,01,1);
196 var news = 0;
197
198 feed = document.location.search.substring(5);
199
200 function setCookie(c_name, value, exdays) {
201 var exdate = new Date();
202 exdate.setDate(exdate.getDate() + exdays);
203 var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
204 document.cookie = c_name + "=" + c_value;
205 }
206
207 function getCookie(c_name) {
208 var c_value = document.cookie;
209 var c_start = c_value.indexOf(" " + c_name + "=");
210 if (c_start == -1) c_start = c_value.indexOf(c_name + "=");
211 if (c_start == -1) c_value = null;
212 else {
213 c_start = c_value.indexOf("=", c_start) + 1;
214 var c_end = c_value.indexOf(";", c_start);
215 if (c_end == -1) c_end = c_value.length;
216 c_value = unescape(c_value.substring(c_start,c_end));
217 }
218 return c_value;
219 }
220
221 function ShowHide(o, e) {
222 var w = document.getElementById(e);
223 if (w) {
224 var sender = (o && o.target) || (window.event && window.event.srcElement);
225
226 if (w.style.display != 'block') w.style.display = 'block';
227 else w.style.display = 'none';
228 }
229 }
230
231 var xmlhttp = new XMLHttpRequest();
232
233 function RSS() {
234 i = 0;
235 news = 0;
236
237 if (feed.indexOf('http') != 0) feed = 'http://' + feed;
238
239 document.getElementById('page').innerHTML = '';
240 document.getElementById('feedurl').href = feed;
241 document.getElementById('feedurl').style.display = 'inline';
242
243 xmlhttp.open("GET", feed, true);
244 try {
245 xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
246 xmlhttp.onreadystatechange = xmlReady;
247 xmlhttp.send();
248 }
249 catch(err) {
250 alert(err);
251 }
252 }
253
254 function xmlReady(e) {
255 if (xmlhttp.readyState == 4) {
256 if (xmlhttp.status == 200) {
257 feedsource = xmlhttp.responseText;
258 doRSS(xmlhttp.responseXML);
259 }
260 }
261 }
262
263 function doRSS(xml) {
264 var div = document.getElementById('page');
265 var xmlDoc = xml;
266
267 document.getElementById("feedtitle").style.display = "block";
268 if (xml == "false") {
269 document.getElementById("feedtitle").innerHTML = "Failed to load feed!";
270 return;
271 }
272
273 if (!xmlDoc) {
274 document.getElementById("feedtitle").innerHTML = "The feed is unavailable!";
275 document.getElementById("feedtitle").style.color = "red";
276 return;
277 }
278 else document.getElementById("feedtitle").style.color = "";
279
280 try {
281 document.getElementById("feedtitle").innerHTML = "";
282 document.getElementById("feedtitle").innerHTML = xmlDoc.getElementsByTagName("title")[0].firstChild.nodeValue.replace(/\r\n|\n|\t/g, "");
283 document.getElementById("feedtitle").href = feedurl;
284 document.title = document.getElementById("feedtitle").innerHTML;
285 }
286 catch(err){}
287
288 try {
289 document.getElementById("banner").style.backgroundImage = "url('" + xmlDoc.getElementsByTagName("image")[0].getElementsByTagName("url")[0].firstChild.nodeValue + "')";
290 document.getElementById("feedurl").href = document.getElementsByTagName("image")[0].getElementsByTagName("link")[0].firstChild.nodeValue;
291 }
292 catch(err) {}
293
294 try {
295 document.getElementById("feedlink").innerHTML = "";
296 document.getElementById("feedlink").innerHTML = "Publisher";
297 document.getElementById("feedlink").href = xmlDoc.getElementsByTagName("link")[0].firstChild.nodeValue;
298 document.getElementById("feedlink").style.display = "inline";
299 }
300 catch(err) {
301 try {
302 document.getElementById("feedlink").innerHTML = "Publisher";
303 document.getElementById("feedlink").href = xmlDoc.getElementsByTagName("link")[0].attributes.getNamedItem("href").value;
304 document.getElementById("feedlink").style.display = "inline";
305 }
306 catch(err2){
307 document.getElementById("feedlink").style.display = "none";
308 }
309 }
310
311 try {
312 document.getElementById("feeddescription").innerHTML = "";
313 document.getElementById("feeddescription").innerHTML = xmlDoc.getElementsByTagName("description")[0].firstChild.nodeValue.replace(/\r\n|\n|\t/g, "");
314 }
315 catch(err) {
316 try {
317 document.getElementById("feeddescription").innerHTML = xmlDoc.getElementsByTagName("subtitle")[0].firstChild.nodeValue.replace(/\r\n|\n|\t/g, "");
318 }
319 catch(err2) {}
320 }
321
322 var hasinfo = false;
323 try {
324 document.getElementById("feedlanguage").innerHTML = "";
325 if (xmlDoc.getElementsByTagName("language")[0].firstChild.nodeValue.length > 2) {
326 document.getElementById("feedlanguage").innerHTML = "<b>Language:</b> " + xmlDoc.getElementsByTagName("language")[0].firstChild.nodeValue.substring(0, 2);
327 document.getElementById("feedlanguage").title = xmlDoc.getElementsByTagName("language")[0].firstChild.nodeValue.substring(0, 2);
328 }
329 else {
330 document.getElementById("feedlanguage").innerHTML = "<b>Language:</b> " + xmlDoc.getElementsByTagName("language")[0].firstChild.nodeValue;
331 document.getElementById("feedlanguage").title = xmlDoc.getElementsByTagName("language")[0].firstChild.nodeValue;
332 }
333 hasinfo = true;
334 }
335 catch(err){}
336
337 try {
338 document.getElementById("feedgenerator").innerHTML = "";
339 document.getElementById("feedgenerator").innerHTML = "<b>Created by:</b> " + xmlDoc.getElementsByTagName("generator")[0].firstChild.nodeValue;
340 hasinfo = true;
341 }
342 catch(err) {
343 try {
344 document.getElementById("feedgenerator").innerHTML = "";
345 document.getElementById("feedgenerator").innerHTML = "<b>Created by:</b> " + xmlDoc.getElementsByTagName("creator")[0].firstChild.nodeValue;
346 hasinfo = true;
347 }
348 catch(err) {
349 }
350 }
351
352 try {
353 document.getElementById("feedcateg").innerHTML = "";
354 if (xmlDoc.getElementsByTagName("category")[0].parentNode.nodeName == "channel") {
355 document.getElementById("feedcateg").innerHTML = "<b>Category:</b> " + xmlDoc.getElementsByTagName("category")[0].firstChild.nodeValue;
356 hasinfo = true;
357 }
358 }
359 catch(err){}
360
361 try {
362 document.getElementById("feededitor").innerHTML = "";
363 document.getElementById("feededitor").innerHTML = "<b>Managing editor:</b> " + xmlDoc.getElementsByTagName("managingEditor")[0].firstChild.nodeValue;
364 hasinfo = true;
365 }
366 catch(err){}
367
368 try {
369 document.getElementById("feedwebmaster").innerHTML = "";
370 document.getElementById("feedwebmaster").innerHTML = "<b>Web master:</b> " + xmlDoc.getElementsByTagName("webMaster")[0].firstChild.nodeValue;
371 hasinfo = true;
372 }
373 catch(err){}
374
375 try {
376 document.getElementById("feedcopyright").innerHTML = "";
377 document.getElementById("feedcopyright").innerHTML = "<b>Copyright:</b> " + xmlDoc.getElementsByTagName("copyright")[0].firstChild.nodeValue;
378 hasinfo = true;
379 }
380 catch(err) {
381 try {
382 document.getElementById("feedcopyright").innerHTML = "";
383 document.getElementById("feedcopyright").innerHTML = "<b>Copyright:</b> " + xmlDoc.getElementsByTagName("rights")[0].firstChild.nodeValue;
384 hasinfo = true;
385 }
386 catch(err) {}
387 }
388
389 try {
390 document.getElementById("pubDate").innerHTML = "";
391 if (xmlDoc.getElementsByTagName("pubDate")[0].parentNode.nodeName == "channel") {
392 document.getElementById("pubDate").innerHTML = "<b>Published:</b> " + new Date(xmlDoc.getElementsByTagName("pubDate")[0].firstChild.nodeValue).toLocaleString();
393 hasinfo = true;
394 }
395 }
396 catch(err){
397 try {
398 document.getElementById("pubDate").innerHTML = "";
399 if (xmlDoc.getElementsByTagName("date")[0].parentNode.nodeName == "channel") {
400 document.getElementById("pubDate").innerHTML = "<b>Published:</b> " + new Date(xmlDoc.getElementsByTagName("date")[0].firstChild.nodeValue).toLocaleString();
401 hasinfo = true;
402 }
403 }
404 catch(err){}
405 }
406
407 try {
408 document.getElementById("lastBuildDate").innerHTML = "";
409 if (xmlDoc.getElementsByTagName("lastBuildDate")[0].parentNode.nodeName == "channel") {
410 document.getElementById("lastBuildDate").innerHTML = "<b>Created at:</b> " + new Date(xmlDoc.getElementsByTagName("lastBuildDate")[0].firstChild.nodeValue).toLocaleString();
411 hasinfo = true;
412 }
413 }
414 catch(err){}
415 if (hasinfo) document.getElementById("feedinfo").style.display = "inline";
416
417 if (xmlDoc.getElementsByTagName("item").length > 0) {
418 //rss
419 document.getElementById("feedtype").innerHTML = '<b>Type:</b> RSS (' + xmlDoc.getElementsByTagName('rss')[0].getAttribute('version') + ')';
420 for (var i = 0; i < xmlDoc.getElementsByTagName("item").length; i++) {
421 var d = document.createElement('div');
422 d.id = "part" + i;
423
424 var dl = null;
425
426 var t = document.createElement('h2');
427 try {
428 var ae0;
429 if (xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("link")[0]) {
430 ae0 = document.createElement('a');
431 ae0.href = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("link")[0].firstChild.nodeValue;
432 dl = ae0;
433 }
434 else {
435 ae0 = document.createElement('span');
436 }
437 ae0.id = "title" + i;
438 ae0.innerHTML = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("title")[0].firstChild.nodeValue;
439 t.appendChild(ae0);
440
441 totop = document.createElement('a');
442 totop.href = '#';
443 totop.target = '_self';
444 totop.className = 'totop';
445 totop.innerHTML = 'to top';
446 t.appendChild(totop);
447
448 markread = document.createElement('span');
449 markread.setAttribute('onClick', "document.getElementById('part" + i + "').style.backgroundColor = '';");
450 markread.className = 'markread';
451 markread.innerHTML = 'mark read';
452 t.appendChild(markread);
453 }
454 catch(err){}
455 d.appendChild(t);
456
457 var l = document.createElement('div');
458 l.className = 'iteminfo';
459 try {
460 var ae2 = document.createElement('span');
461 ae2.id = "pubDate" + i;
462 ae2.name = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("pubDate")[0].firstChild.nodeValue;
463 ae2.innerHTML = new Date(ae2.name).toLocaleString().replace(/ /g, "&nbsp;");
464 l.appendChild(ae2);
465 }
466 catch(err) {
467 try {
468 var ae2 = document.createElement('span');
469 ae2.id = "pubDate" + i;
470 ae2.name = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("date")[0].firstChild.nodeValue;
471 ae2.innerHTML = new Date(ae2.name).toLocaleString().replace(/ /g, "&nbsp;");
472 l.appendChild(ae2);
473 }
474 catch(err){}
475 }
476
477 try {
478 var ae4 = document.createElement('a');
479 ae4.id = "author" + i;
480 ae4.href = "mailto:" + xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("email")[0].firstChild.nodeValue;
481 ae4.innerHTML = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("author")[0].firstChild.nodeValue.replace(/ /g, "&nbsp;");
482 l.appendChild(ae4);
483 }
484 catch(err) {
485 try {
486 var ae4 = document.createElement('a');
487 ae4.id = "author" + i;
488 ae4.href = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("authorUrl")[0].firstChild.nodeValue;
489 ae4.innerHTML = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("author")[0].firstChild.nodeValue.replace(/ /g, "&nbsp;");
490 l.appendChild(ae4);
491 }
492 catch(err) {
493 try {
494 var ae4 = document.createElement('span');
495 ae4.id = "author" + i;
496 ae4.innerHTML = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("author")[0].firstChild.nodeValue.replace(/ /g, "&nbsp;");
497 l.appendChild(ae4);
498 }
499 catch(err) {
500 try {
501 var ae4 = document.createElement('span');
502 ae4.id = "author" + i;
503 ae4.innerHTML = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("creator")[0].firstChild.nodeValue.replace(/ /g, "&nbsp;");
504 l.appendChild(ae4);
505 }
506 catch(err) {}
507 }
508 }
509 }
510
511 try {
512 var ae5 = document.createElement('a');
513 ae5.id = "comments" + i;
514 try {
515 var cc = xmlDoc.getElementsByTagName("item")[i].getElementsByTagNameNS("http://purl.org/rss/1.0/modules/slash/", "comments")[0].firstChild.nodeValue;
516 if (cc > 0) ae5.innerHTML = "Comments (" + cc + ")";
517 else ae5.innerHTML = "Comments";
518 }
519 catch(err){
520 try {
521 var cc = xmlDoc.getElementsByTagName("item")[i].getElementsByTagNameNS("http://purl.org/atompub/rank/1.0", "rank")[0].firstChild.nodeValue;
522 if (cc > 0) ae5.innerHTML = "Comments (" + cc + ")";
523 else ae5.innerHTML = "Comments";
524 }
525 catch(err){
526 ae5.innerHTML = "Comments";
527 }
528 }
529 ae5.href = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("comments")[0].firstChild.nodeValue;
530 l.appendChild(ae5);
531 }
532 catch(err){}
533
534 var aec = document.createElement('div');
535 try {
536 var category = '';
537 if (xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("category")[0]) {
538 for (var c = 0; c < xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("category").length; c++) {
539 var cc = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("category")[c].firstChild.nodeValue;
540 category = category + "<span onclick='FilterByTag(this)'>" + cc + "</span>";
541 if (document.getElementById('feedcategory').innerHTML.indexOf(cc) == -1) document.getElementById('feedcategory').innerHTML += "<span onclick='FilterByTag(this)'>" + cc + "</span>";
542 }
543 }
544 else if (xmlDoc.getElementsByTagName("item")[i].getElementsByTagNameNS("http://enyim.com/schemas/blossom/2008/feed/", "tag")[0]) {
545 for (var c = 0; c < xmlDoc.getElementsByTagName("item")[i].getElementsByTagNameNS("http://enyim.com/schemas/blossom/2008/feed/", "tag").length; c++) {
546 var cc = xmlDoc.getElementsByTagName("item")[i].getElementsByTagNameNS("http://enyim.com/schemas/blossom/2008/feed/", "tag")[c].firstChild.nodeValue;
547 category = category + "<span onclick='FilterByTag(this)'>" + cc + "</span>";
548 if (document.getElementById('feedcategory').innerHTML.indexOf(cc) == -1) document.getElementById('feedcategory').innerHTML += "<span onclick='FilterByTag(this)'>" + cc + "</span>";
549 }
550 }
551
552 if (category != '') {
553 var aecl = document.createElement('span');
554 aecl.innerHTML = "Category";
555 aecl.className = 'itemlink';
556 aecl.setAttribute('onClick', "ShowHide(this, 'category" + i + "')");
557 l.appendChild(aecl);
558
559 aec.id = "category" + i;
560 aec.className = 'itemcategory';
561 aec.innerHTML = category;
562 aec.style.display = "none";
563
564 document.getElementById('feedtags').style.display = 'inline';
565 }
566 }
567 catch(err) {
568 aec = null;
569 }
570
571 var ddiv = document.createElement('div');
572
573 if (xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("image")[0]) {
574 var image = document.createElement('img');
575 image.style.display = 'block',
576 image.style.marginLeft = 'auto';
577 image.style.marginRight = 'auto';
578 image.src = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("image")[0].firstChild.nodeValue;
579 ddiv.appendChild(image);
580 }
581
582 if (xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("enclosure")[0]) {
583 if (xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("enclosure")[0].getAttribute('type').indexOf('image') == 0) {
584 var image = document.createElement('img');
585 image.style.display = 'block',
586 image.style.marginLeft = 'auto';
587 image.style.marginRight = 'auto';
588 image.src = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("enclosure")[0].getAttribute('url');
589 ddiv.appendChild(image);
590 }
591 else {
592 var enclosure = document.createElement('a');
593 enclosure.innerHTML = 'Enclosure';
594 enclosure.href = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("enclosure")[0].getAttribute('url');
595 l.appendChild(enclosure);
596 }
597 }
598
599 ddiv.id = "ddiv" + i;
600 ddiv.style.display = "block";
601 try {
602 var ae3 = document.createElement('p');
603 ae3.className = 'description';
604 ae3.id = "description" + i;
605 ae3.innerHTML = xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("description")[0].childNodes[0].data;
606 ae3.innerHTML = ae3.innerHTML.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
607 if (ae3.innerHTML == 0 || ae3.innerHTML == "&nbsp;") ae3.className = "none";
608 ddiv.appendChild(ae3);
609 }
610 catch(err) {
611 var ae3 = document.createElement('p');
612 ae3.className = 'description';
613 ae3.id = "description" + i;
614 try {
615 if (xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("description")[0].firstChild) ae3.innerHTML = err;
616 } catch(err2){}
617 ae3.style.color = "red";
618 if (ae3.innerHTML == 0 || ae3.innerHTML == "&nbsp;") ae3.className = "none";
619 ddiv.appendChild(ae3);
620 }
621
622 var f = document.createElement('div');
623 if (ae3.innerHTML != 0 && ae3.innerHTML != "&nbsp;") {
624 var ff = document.createElement('div');
625 ff.className = 'group';
626
627 var e = document.createElement('span');
628 e.innerHTML = 'Translate with:';
629 ff.appendChild(e);
630
631 var eg = document.createElement('a');
632 eg.innerHTML = 'Google';
633 eg.href = 'http://translate.google.com/#' + document.getElementById('feedlanguage').title + '/' + language.substring(0, 2) + '/' + encodeURIComponent(ae3.outerText);
634 ff.appendChild(eg);
635
636 var eb = document.createElement('a');
637 eb.innerHTML = 'Bing';
638 eb.href = 'http://www.bing.com/translator/?SourceText=' + encodeURIComponent(ae3.outerText);
639 ff.appendChild(eb);
640
641 f.appendChild(ff);
642 }
643
644 if (dl) {
645 var fm = document.createElement('div');
646 fm.className = 'group';
647
648 var e = document.createElement('span');
649 e.innerHTML = 'Share with:';
650 fm.appendChild(e);
651
652 var ee = document.createElement('a');
653 ee.innerHTML = 'E-mail';
654 ee.href = 'mailto:?subject=' + ae0.innerHTML + '&body=' + dl.href;
655 fm.appendChild(ee);
656
657 var ef = document.createElement('a');
658 ef.innerHTML = 'Facebook';
659 ef.href = 'http://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(dl.href);
660 fm.appendChild(ef);
661
662 var et = document.createElement('a');
663 et.innerHTML = 'Twitter';
664 et.href = 'http://twitter.com/share?url=' + dl.href;
665 fm.appendChild(et);
666
667 var eg = document.createElement('a');
668 eg.innerHTML = 'Google+';
669 eg.href = 'https://plus.google.com/share?url=' + dl.href;
670 fm.appendChild(eg);
671
672 f.appendChild(fm);
673 }
674 ddiv.appendChild(f);
675 if (l.childNodes.length > 0) d.appendChild(l);
676 if (aec) d.appendChild(aec);
677 d.appendChild(ddiv);
678 div.appendChild(d);
679 }
680 }
681 else {
682 //atom
683 document.getElementById("feedtype").innerHTML = '<b>Type:</b> ATOM';
684 for (var i = 0; i < xmlDoc.getElementsByTagName("entry").length; i++) {
685 var d = document.createElement('div');
686 d.id = "part" + i;
687
688 var dl = null;
689
690 var t = document.createElement('h2');
691 try {
692 var ae0;
693 if (xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("link")[0].attributes.getNamedItem("href").value) {
694 ae0 = document.createElement('a');
695 ae0.href = xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("link")[0].attributes.getNamedItem("href").value;
696 dl = ae0;
697 }
698 else {
699 ae0 = document.createElement('span');
700 }
701 ae0.id = "title" + i;
702 ae0.innerHTML = xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("title")[0].firstChild.nodeValue;
703 t.appendChild(ae0);
704
705 totop = document.createElement('a');
706 totop.href = '#';
707 totop.target = '_self';
708 totop.className = 'totop';
709 totop.innerHTML = 'to top';
710 t.appendChild(totop);
711
712 markread = document.createElement('span');
713 markread.setAttribute('onClick', "document.getElementById('part" + i + "').style.backgroundColor = '';");
714 markread.className = 'markread';
715 markread.innerHTML = 'mark read';
716 t.appendChild(markread);
717 }
718 catch(err){}
719 d.appendChild(t);
720
721 var l = document.createElement('div');
722 l.className = 'iteminfo';
723 try {
724 var ae2 = document.createElement('span');
725 ae2.id = "pubDate" + i;
726 ae2.name = xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("published")[0].firstChild.nodeValue;
727 ae2.innerHTML = new Date(ae2.name).toLocaleString().replace(/ /g, "&nbsp;");
728 l.appendChild(ae2);
729 }
730 catch(err){}
731
732 try {
733 var ae4 = document.createElement('a');
734 ae4.id = "author" + i;
735 ae4.innerHTML = xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("name")[0].firstChild.nodeValue;
736 ae4.href = "mailto:" + xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("email")[0].firstChild.nodeValue;
737 l.appendChild(ae4);
738 }
739 catch(err) {
740 try {
741 var ae4 = document.createElement('span');
742 ae4.id = "author" + i;
743 ae4.innerHTML = xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("name")[0].firstChild.nodeValue;
744 l.appendChild(ae4);
745 }
746 catch(err2){}
747 }
748
749 var aec = document.createElement('div');
750 try {
751 if (xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("category")[0]) {
752 var category = '';
753 for (var c = 0; c < xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("category").length; c++) {
754 var cc = xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("category")[c].firstChild.nodeValue;
755 category = category + "<span onclick='FilterByTag(this)'>" + cc + "</span>";
756 if (document.getElementById('feedcategory').innerHTML.indexOf(cc) == -1) document.getElementById('feedcategory').innerHTML += "<span onclick='FilterByTag(this)'>" + cc + "</span>";
757 }
758
759 var aecl = document.createElement('span');
760 aecl.innerHTML = "Category";
761 aecl.className = 'itemlink';
762 aecl.setAttribute('onClick', "ShowHide(this, 'category" + i + "')");
763 l.appendChild(aecl);
764
765 aec.id = "category" + i;
766 aec.className = 'itemcategory';
767 aec.innerHTML = category;
768 aec.style.display = "none";
769
770 document.getElementById('feedtags').style.display = 'inline';
771 }
772 }
773 catch(err) {
774 aec = null;
775 }
776
777 var ddiv = document.createElement('div');
778 ddiv.id = "ddiv" + i;
779 ddiv.style.display = "block";
780 try {
781 var ae3 = document.createElement('p');
782 ae3.id = "description" + i;
783 ae3.className = "description";
784 ae3.innerHTML = xmlDoc.getElementsByTagName("entry")[i].getElementsByTagName("content")[0].childNodes[0].data;
785 ae3.innerHTML = ae3.innerHTML.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
786 if (ae3.innerHTML == 0 || ae3.innerHTML == "&nbsp;") ae3.className = "none";
787 ddiv.appendChild(ae3);
788 }
789 catch(err) {
790 var ae3 = document.createElement('p');
791 ae3.id = "description" + i;
792 ae3.className = "description";
793 if (xmlDoc.getElementsByTagName("item")[i]) {
794 if (xmlDoc.getElementsByTagName("item")[i].getElementsByTagName("content")[0].firstChild) ae3.innerHTML = err;
795 }
796 ae3.style.color = "red";
797 if (ae3.innerHTML == 0 || ae3.innerHTML == "&nbsp;") ae3.className = "none";
798 ddiv.appendChild(ae3);
799 }
800
801 var f = document.createElement('div');
802 if (ae3.innerHTML != 0 && ae3.innerHTML != "&nbsp;") {
803 var ff = document.createElement('div');
804 ff.className = 'group';
805
806 var e = document.createElement('span');
807 e.innerHTML = 'Translate with:';
808 ff.appendChild(e);
809
810 var eg = document.createElement('a');
811 eg.innerHTML = 'Google';
812 eg.href = 'http://translate.google.com/#' + document.getElementById('feedlanguage').title + '/' + language.substring(0, 2) + '/' + encodeURIComponent(ae3.outerText);
813 ff.appendChild(eg);
814
815 var eb = document.createElement('a');
816 eb.innerHTML = 'Bing';
817 eb.href = 'http://www.bing.com/translator/?SourceText=' + encodeURIComponent(ae3.outerText);
818 ff.appendChild(eb);
819
820 f.appendChild(ff);
821 }
822
823 if (dl) {
824 var fm = document.createElement('div');
825 fm.className = 'group';
826
827 var e = document.createElement('span');
828 e.innerHTML = 'Share with:';
829 fm.appendChild(e);
830
831 var ee = document.createElement('a');
832 ee.innerHTML = 'E-mail';
833 ee.href = 'mailto:?subject=' + ae0.innerHTML + '&body=' + dl.href;
834 fm.appendChild(ee);
835
836 var ef = document.createElement('a');
837 ef.innerHTML = 'Facebook';
838 ef.href = 'http://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(dl.href);
839 fm.appendChild(ef);
840
841 var et = document.createElement('a');
842 et.innerHTML = 'Twitter';
843 et.href = 'http://twitter.com/share?url=' + dl.href;
844 fm.appendChild(et);
845
846 var eg = document.createElement('a');
847 eg.innerHTML = 'Google+';
848 eg.href = 'https://plus.google.com/share?url=' + dl.href;
849 fm.appendChild(eg);
850
851 f.appendChild(fm);
852 }
853 ddiv.appendChild(f);
854 d.appendChild(l);
855 if (aec) d.appendChild(aec);
856 d.appendChild(ddiv);
857 div.appendChild(d);
858 }
859 }
860
861 var parts = document.getElementById('page').childNodes;
862 if (document.getElementById('checkit').checked) {
863 for (var i = 0; i < parts.length; i++) {
864 var p = document.getElementById('part' + i);
865 var d = new Date(document.getElementById('pubDate' + i).name);
866 if (d > lastread) {
867 p.style.backgroundColor = '#fff0f0';
868 news += 1;
869 if (document.getElementById('scrollit').checked) p.scrollIntoView(false);
870 }
871 else p.style.backgroundColor = '';
872 }
873 }
874
875 document.getElementById('feeditems').innerHTML = '<b>Items:</b> ' + parts.length;
876 if (news > 0) {
877 document.title = '(' + news + ') ' + document.title;
878 document.getElementById('feeditems').innerHTML = document.getElementById('feeditems').innerHTML + ' (' + news + ' new)';
879 document.getElementById('feedmarkread').style.display = 'block';
880 }
881 }
882
883 function FilterByTag(c) {
884 var d = document.getElementById('page').childNodes;
885
886 for (var i = 0; i < d.length; i++) {
887 var p = document.getElementById('part' + i);
888 if (document.getElementById('category' + i).innerHTML.indexOf(c.innerHTML) >= 0) p.style.display = 'block';
889 else p.style.display = 'none';
890 }
891 }
892
893 function FeedSource() {
894 var sz = document.getElementById("pagesource");
895
896 if (sz.style.display == "block") {
897 sz.innerHTML = "";
898 sz.style.display = "none";
899 }
900 else {
901 var f = document.createElement('pre');
902 f.innerHTML = feedsource.replace(/</g, "&lt;").replace(/>/g, "&gt;");
903 sz.appendChild(f);
904 sz.style.display = "block";
905 }
906 }
907
908 function Filter() {
909 var d = document.getElementById('page').childNodes;
910 var f = document.getElementById('filter').value
911
912 if (f == '') {
913 for (var i = 0; i < d.length; i++) {
914 var p = document.getElementById('part' + i);
915 p.style.display = 'block';
916 }
917 }
918
919 if (f.indexOf('!') == 0) {
920 f = f.replace('!', '');
921 for (var i = 0; i < d.length; i++) {
922 var p = document.getElementById('part' + i);
923 if ((document.getElementById('title' + i).innerHTML.indexOf(f) >= 0) || (document.getElementById('description' + i).innerHTML.indexOf(f) >= 0)) p.style.display = 'none';
924 else p.style.display = 'block';
925 }
926 }
927 else {
928 for (var i = 0; i < d.length; i++) {
929 var p = document.getElementById('part' + i);
930 if ((document.getElementById('title' + i).innerHTML.indexOf(f) >= 0) || (document.getElementById('description' + i).innerHTML.indexOf(f) >= 0)) p.style.display = 'block';
931 else p.style.display = 'none';
932 }
933 }
934 }
935
936 function SetUpdate(o) {
937 if (o.checked) {
938 interval = setInterval(function(){Update()}, 1000);
939 document.getElementById('feedmarkread').style.display = 'inline';
940 document.getElementById('reload').style.display = 'inline';
941 }
942 else {
943 clearInterval(interval);
944 document.getElementById('feedmarkread').style.display = 'none';
945 document.getElementById('reload').style.display = 'none';
946 }
947 document.getElementById('update5').disabled = !o.checked;
948 document.getElementById('update15').disabled = !o.checked;
949 document.getElementById('update30').disabled = !o.checked;
950 document.getElementById('update60').disabled = !o.checked;
951 document.getElementById('update90').disabled = !o.checked;
952 }
953
954 function SetCheck(o) {
955 document.getElementById('scrollit').disabled = !o.checked;
956 }
957
958 function Update() {
959 if (i >= imax) RSS();
960 else i += 1;
961
962 document.getElementById('reloadbar').style.width = (Number(document.getElementById('reload').style.width.replace(/[^\d\.\-]/g, '')) / (imax / i)) + 'px';
963 if ((imax - i) < 60) document.getElementById('reload').title = 'Automatic refresh after ' + (imax - i) + 's. Click to refresh now.';
964 else document.getElementById('reload').title = 'Automatic refresh after ' + Math.floor((imax - i) / 60) + 'm. Click to refresh now.';
965
966 }
967
968 function FeedPreferences() {
969 if (document.getElementById('feedpreferences').style.display == 'none') document.getElementById('feedpreferences').style.display = 'block'
970 else document.getElementById('feedpreferences').style.display = 'none'
971 }
972
973 function FeedMarkRead(c) {
974 lastread = new Date();
975 c.title = lastread.toLocaleString();
976 var parts = document.getElementById('page').childNodes;
977 for (var i = 0; i < parts.length; i++) {
978 var p = document.getElementById('part' + i);
979 p.style.backgroundColor = '';
980 }
981 c.style.display = 'none';
982 }
983
984 function SaveSettings() {
985 window.name = '';
986 window.name += document.getElementById('updateit').value + ';';
987 window.name += document.getElementById('checkit').value + ';';
988 window.name += document.getElementById('scrollit').value;
989 document.getElementById('feedpreferences').style.display = 'none';
990 }
991 //-->
992 </script>
993 <base target='_blank'/>
994</head>
995<body>
996 <div id='content'>
997 <div id='banner'>
998 <div id='feeddescription'>&nbsp;</div>
999 <span id='feedtitle'></span>
1000 </div>
1001 <div id='bannerbar'>
1002 <span id='feedinfo' onclick="ShowHide(this, 'feedinfos')" style='cursor: pointer;'>Information</span>
1003 <a id='feedlink' href=''>Publisher</a>
1004 <span id='feedtags' onclick="ShowHide(this, 'feedcategory')" style='cursor: pointer; display: none;'>Category</span>
1005 <div id='reload' onclick='RSS();' style='width: 80px; border: solid thin #b0b0ff; padding: 1px; margin-right: 2px; background-color: white; font-size: 0.6em; cursor: pointer; float: right; display: none;'>
1006 <div id='reloadbar' style='width: 0px; background-color: #b0b0ff;'>&nbsp;</div>
1007 </div>
1008 <span onclick='FeedPreferences();' style='cursor: pointer; float: right;'>Preferences</span>
1009 <a id='feedurl' href='' style='display: none; float: right;'>Url</a>
1010 <span onclick='FeedSource();' style='cursor: pointer; float: right;'>Show source</span>
1011 <span id='feedmarkread' onclick='FeedMarkRead(this);' style='cursor: pointer; float: right; display: none;'>Mark all read</span>
1012 </div>
1013
1014 <div id='feedinfos' style='display: none;'>
1015 <div id='feedtype'></div>
1016 <div id='pubDate'></div>
1017 <div id='lastBuildDate'></div>
1018 <div id='feedlanguage'></div>
1019 <div id='feedcateg'></div>
1020 <div id='feedgenerator'></div>
1021 <div id='feededitor'></div>
1022 <div id='feedwebmaster'></div>
1023 <div id='feedcopyright'></div>
1024 <div id='feeditems'></div>
1025 </div>
1026 <div id='feedcategory' style='display: none;'></div>
1027
1028 <div id='feedpreferences' style='display: none;'>
1029 <fieldset>
1030 <legend>Automatic update</legend>
1031 <input id='updateit' name='updateit' type='checkbox' onclick='SetUpdate(this); setCookie(this.id, this.checked, 365);'/>Update in every
1032 <input id='update5' name='update' value='5' type='radio' onclick='imax = (this.value * 60); setCookie(this.id, this.checked, 365);' disabled='disabled'/>
1033 <label for='update5'>5</label>
1034 <input id='update15' name='update' value='15' type='radio' checked='checked' onclick='imax = (this.value * 60); setCookie(this.id, this.checked, 365);' disabled='disabled'/>
1035 <label for='update15'>15</label>
1036 <input id='update30' name='update' value='30' type='radio' onclick='imax = (this.value * 60); setCookie(this.id, this.checked, 365);' disabled='disabled'/>
1037 <label for='update30'>30</label>
1038 <input id='update60' name='update' value='60' type='radio' onclick='imax = (this.value * 60); setCookie(this.id, this.checked, 365);' disabled='disabled'/>
1039 <label for='update60'>60</label>
1040 <input id='update90' name='update' value='90' type='radio' onclick='imax = (this.value * 60); setCookie(this.id, this.checked, 365);' disabled='disabled'/>
1041 <label for='update90'>90</label>
1042 <span>minutes</span>
1043 </fieldset>
1044 <fieldset>
1045 <legend>New items</legend>
1046 <input id='checkit' name='checkit' type='checkbox' onclick='SetCheck(this); setCookie(this.id, this.checked, 365);'/>Check for new items
1047 <input id='scrollit' name='scrollit' type='checkbox' onclick='setCookie(this.id, this.checked, 365);' disabled='disabled'/>Scroll to the first new item
1048 </fieldset>
1049 <input id='submitOK' name='submitOK' type='submit' value='OK' onclick="document.getElementById('feedpreferences').style.display = 'none'"/>
1050 <input id='submitSave' name='submitSave' type='submit' value='Save in this session' onclick='SaveSettings();'/>
1051 </div>
1052
1053 <div id='pagesource' style='display: none; margin-top: 10px;'></div>
1054
1055 <div id='feedfilter' style='position: relative; margin-top: 5px; text-align: right; font-size: 0.8em;'>
1056 <label for='filter'>Filter items</label>
1057 <input id='filter' name='filter' value='' onkeydown='Filter();' style='width: 80px;'/>
1058 </div>
1059
1060 <div id='page'></div>
1061 </div>
1062
1063 <script type='text/javascript'>
1064 <!--
1065 document.getElementById('updateit').checked = getCookie('updateit');
1066
1067 if (document.getElementById('updateit').checked) document.getElementById('reload').style.display = 'inline';
1068 document.getElementById('update5').disabled = !document.getElementById('updateit').checked;
1069 document.getElementById('update15').disabled = !document.getElementById('updateit').checked;
1070 document.getElementById('update30').disabled = !document.getElementById('updateit').checked;
1071 document.getElementById('update60').disabled = !document.getElementById('updateit').checked;
1072 document.getElementById('update90').disabled = !document.getElementById('updateit').checked;
1073
1074 document.getElementById('checkit').checked = getCookie('checkit');
1075 document.getElementById('scrollit').checked = getCookie('scrollit');
1076 document.getElementById('scrollit').disabled = !document.getElementById('checkit').checked;
1077/* if (window.name) {
1078 var settings = window.name.split(';');
1079 document.getElementById('updateit').checked = settings[0];
1080
1081 if (document.getElementById('updateit').checked) document.getElementById('reload').style.display = 'inline';
1082 document.getElementById('update5').disabled = !document.getElementById('updateit').checked;
1083 document.getElementById('update15').disabled = !document.getElementById('updateit').checked;
1084 document.getElementById('update30').disabled = !document.getElementById('updateit').checked;
1085 document.getElementById('update60').disabled = !document.getElementById('updateit').checked;
1086 document.getElementById('update90').disabled = !document.getElementById('updateit').checked;
1087
1088 document.getElementById('checkit').checked = settings[1];
1089 document.getElementById('scrollit').checked = settings[2];
1090 document.getElementById('scrollit').disabled = !document.getElementById('checkit').checked;
1091 }*/
1092 RSS();
1093 if (document.getElementById('updateit').checked) interval = setInterval(function(){Update()}, 1000);
1094 //-->
1095 </script>
1096</body>
1097</html>