
(function(document, window, $){
  var apiUrl = 'http://' +  window.location.hostname + ':' + window.location.port;

  var garageDoorStatus = function(){
    return $.get(apiUrl + '/status');
  };

  var toggleGarageDoor = function(){
    return $.post(apiUrl + '/toggle');
  }

  $('#toggleBtn').on('click', function(){
    toggleGarageDoor();
  });

  setInterval(function(){
    garageDoorStatus().done(function(response){
      $('#status').text(response.text);
    });
  }, 1000)

})(document, window, $)

@@ -322,27 +322,175 @@
     
-toggleGarageDoor();
+$('#toggleBtn').prop(%22disabled%22,true);%0A    toggleGarageDoor();%0A    setTimeout(function()%7B%0A      $('#toggleBtn').prop(%22disabled%22,false);%0A    %7D, 1000 * 10); //10 seconds
 %0A  %7D

Disable button on click :: master