Difference between revisions of "Widget:Pamela"

From Whitespace (Hackerspace Gent)
Jump to: navigation, search
Line 18: Line 18:
 
function ProcessRequest()
 
function ProcessRequest()
 
{
 
{
     if ( xmlHttp.readyState == 4 && xmlHttp.status == 200 )
+
    var macs, i;
    {
+
 
         if ( xmlHttp.responseText != "Not found" )
+
     if ( !(xmlHttp.readyState == 4 && xmlHttp.status == 200))
         {
+
         return;
            var macs = eval ( "(" + xmlHttp.responseText + ")" );
+
    if ( xmlHttp.responseText == "Not found" )
            document.getElementById( "pamelaWidget" ).innerHTML = "According to <a href='http://0x20.be/Pamela'>Pamela</a> there are " + macs.length + " devices active in the space: " + macs.join( ", " );
+
         return;
         }      
+
 
 +
    macs = eval ( "(" + xmlHttp.responseText + ")" );
 +
    for (i = 0; i < macs.length; i++) {
 +
        if (macs[i].indexOf('(')) == -1) {
 +
            document.getElementById('openbanner').style.display = 'block';
 +
            break;
 +
         }
 
     }
 
     }
 +
    document.getElementById( "pamelaWidget" ).innerHTML = "According to <a href='http://0x20.be/Pamela'>Pamela</a> there are " + macs.length + " devices active in the space: " + macs.join( ", " );
 +
        }       
 
}
 
}
  

Revision as of 22:30, 19 December 2010