diff --git a/example-multipleServers-full.html b/example-multipleServers-full.html index 6ad30b5..7050afb 100644 --- a/example-multipleServers-full.html +++ b/example-multipleServers-full.html @@ -125,19 +125,18 @@ function startStop(){ //speedtest is running, abort s.abort(); data=null; - I("startStopBtn").className=""; I("server").disabled=false; initUI(); }else{ //test is not running, begin - I("startStopBtn").className="running"; + updateStartStopButton(true); I("shareArea").style.display="none"; I("server").disabled=true; s.onupdate=function(data){ uiData=data; }; s.onend=function(aborted){ - I("startStopBtn").className=""; + updateStartStopButton(false); I("server").disabled=false; updateUI(true); if(!aborted){ @@ -157,6 +156,16 @@ function startStop(){ s.start(); } } +function updateStartStopButton(running) { + var btn=I("startStopBtn"); + if(running){ + btn.className="running"; + btn.textContent="Abort"; + }else{ + btn.className=""; + btn.textContent="Start"; + } +} //this function reads the data sent back by the test and updates the UI function updateUI(forced){ if(!forced&&s.getState()!=3) return; @@ -224,7 +233,6 @@ function initUI(){ 100%{transform:rotate(359deg);} } #startStopBtn{ - display:inline-block; margin:0 auto; color:#6060AA; background-color:rgba(0,0,0,0); @@ -234,7 +242,6 @@ function initUI(){ box-sizing:border-box; width:8em; height:3em; line-height:2.7em; - cursor:pointer; box-shadow: 0 0 0 rgba(0,0,0,0.1), inset 0 0 0 rgba(0,0,0,0.1); } #startStopBtn:hover{ @@ -245,12 +252,6 @@ function initUI(){ border-color:#FF6060; color:#FFFFFF; } - #startStopBtn:before{ - content:"Start"; - } - #startStopBtn.running:before{ - content:"Abort"; - } #serverArea{ margin-top:1em; } @@ -401,7 +402,7 @@ function initUI(){

Selecting a server...