update.js
1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var currloc = location.pathname.substring(0,location.pathname.lastIndexOf('/')+1);
var user = '';
function CheckVersion(){
xmlHttpAdmin=GetXmlHttpAdminObject();
if (xmlHttpAdmin===null){
alert ("Browser does not support HTTP Request");
return;
}
var url=VERSIONS_URL;
xmlHttpAdmin.onreadystatechange=adminStateChanged;
xmlHttpAdmin.open("GET",url,true);
xmlHttpAdmin.send(null);
}
function adminStateChanged(){
if (xmlHttpAdmin.readyState==4 || xmlHttpAdmin.readyState=="complete"){
if(xmlHttpAdmin.responseText != ""){
document.getElementById("AdminVersionDashlet").style.display = "block";
document.getElementById("AdminVersionBlock").innerHTML=xmlHttpAdmin.responseText;
}
}else{
//dashlet not shown until new version is returned so this print isn't needed
//document.getElementById("AdminVersionBlock").innerHTML="Checking Versions";
}
}
function GetXmlHttpAdminObject(){
var objXMLHttpAdmin=null;
if (window.XMLHttpRequest){
objXMLHttpAdmin=new XMLHttpRequest();
}else if (window.ActiveXObject){
objXMLHttpAdmin=new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttpAdmin;
}