Difference between revisions of "Widget:Pamela"

From Whitespace (Hackerspace Gent)
Jump to: navigation, search
m
Line 26: Line 26:
  
 
     macs = eval ( "(" + xmlHttp.responseText + ")" );
 
     macs = eval ( "(" + xmlHttp.responseText + ")" );
     for (i = 0; i < macs.length; i++) {
+
    var isOpen = false;
 +
     for (i = macs.length -1; i >= 0; i--) {
 
         if (macs[i].indexOf('(') == -1) {
 
         if (macs[i].indexOf('(') == -1) {
             document.getElementById('openbanner').style.display = 'block';
+
             isOpen = true;
 
             break;
 
             break;
 
         }
 
         }
 
     }
 
     }
 +
    document.getElementById('openbanner').style.display = isOpen ? 'block' : 'none';
 
     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( ", " );
 
     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:40, 19 December 2010