MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

function convertDate(dateString) { dc = dateString.split(" "); dd = dc[3] + "-" + dc[2] + "-" + dc[1] return dd; }

function getrss { feed1 = document.getElementById("feedholder"); if (feed1) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP") } xhttp.open("GET","/export/rss2_keepsake.php?group_id=49159", false); xhttp.send(""); xmlDoc=xhttp.responseXML.getElementsByTagName("item"); str = " Latest activity  "; for(var i=0; i<5; i++){ // str += "" + xmlDoc[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue + " : "; str += "" + convertDate(xmlDoc[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue) + " : "; str += ""; str += xmlDoc[i].getElementsByTagName("title")[0].childNodes[0].nodeValue; str += ""; }       str += ""; feed1.innerHTML = str; }   feed2 = document.getElementById("mantisholder"); if (feed2) { xhttp.open("GET","/apps/mantisbt/free-cad/issues_rss.php?project_id=0", false); xhttp.send(""); xmlDoc=xhttp.responseXML.getElementsByTagName("item"); str = " Latest issues  "; for(var i=0; i<5; i++){ tag = xmlDoc[i].getElementsByTagName("title")[0].childNodes[0].nodeValue; str += "" + tag.substring(0,7) + " : "; str += ""; str += tag.substring(9,tag.length) + "</a></li>"; }       str += "</ul>"; feed2.innerHTML = str; } }

addOnloadHook(getrss);