some global js functions

This commit is contained in:
Ron Pedde 2005-11-20 10:02:31 +00:00
parent 3fe312ead6
commit 7cf7d23bc4
2 changed files with 48 additions and 2 deletions

View File

@ -7,12 +7,12 @@ adminroot_DATA = ftr.html linkOpaque.gif status.html aspl-license.txt \
mt-daapd.css mt-daapd.png config.html index.html required.gif \
gpl-license.html aspl-license.html thanks.html feedback.html \
playlist.html playlist.js smart.html smart.js DAAPApplet-0.1.jar \
smartpopup.html applet.html CREDITS
smartpopup.html applet.html mt-daapd.js CREDITS
EXTRA_DIST = ftr.html linkOpaque.gif status.html aspl-license.txt \
gpl-license.txt linkTransparent.gif config-update.html hdr.html \
mt-daapd.css mt-daapd.png config.html index.html required.gif \
gpl-license.html aspl-license.html thanks.html feedback.html \
playlist.html playlist.js smart.html smart.js DAAPApplet-0.1.jar \
smartpopup.html applet.html CREDITS
smartpopup.html applet.html mt-daapd.js CREDITS

46
admin-root/mt-daapd.js Executable file
View File

@ -0,0 +1,46 @@
/* JavaScript file containing basic stuff */
var reqStatus;
var globalStatus = new Array();
function popUp(URL)
{ day = new Date();
id = day.getTime();
eval("pagemtdaapdplPop = window.open(URL, 'mtdaapdple', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=240,left=320,top=448');");
}
/* Temporary stuff follows */
function processStatus()
{ globalStatus['statistics'] = new Array();
var xmldoc = reqStatus.responseXML;
}
function reqStatusStateChange()
{ if(reqStatus.readyState == 4)
{ if(reqStatus.status == 200)
{ processStatus();
}
}
}
function getStatusXML(url, async)
{ // branch for native XMLHttpRequest object
if (window.XMLHttpRequest)
{ reqStatus = new XMLHttpRequest();
reqStatus.onreadystatechange = reqStatusStateChange;
reqStatus.open("GET", url, async);
return reqStatus.send(null);
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject)
{ reqStatus = new ActiveXObject("Microsoft.XMLHTTP");
if (reqStatus)
{ reqStatus.onreadystatechange = reqStatusStateChange;
reqStatus.open("GET", url, async);
return reqStatus.send();
}
}
}