From f071ce0d840d3cc19316119351f51b380abc71d0 Mon Sep 17 00:00:00 2001 From: charitha Date: Sat, 23 Jul 2016 10:51:14 +0530 Subject: [PATCH] Fix issues mentioned in PR https://github.com/wso2/product-iots/pull/83 --- .../component/agent/src/main/webapp/index.jsp | 25 +++++++----------- .../agent/src/main/webapp/js/coffee.js | 26 +++++++++---------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/modules/samples/connectedcup/component/agent/src/main/webapp/index.jsp b/modules/samples/connectedcup/component/agent/src/main/webapp/index.jsp index 79c5fa3b..1d68c7ae 100644 --- a/modules/samples/connectedcup/component/agent/src/main/webapp/index.jsp +++ b/modules/samples/connectedcup/component/agent/src/main/webapp/index.jsp @@ -19,11 +19,9 @@ Connected Coffee Cup - - @@ -48,7 +46,6 @@ if (token != null) { request.getSession().setAttribute("token", token); } - %>
@@ -100,22 +97,19 @@ \ No newline at end of file diff --git a/modules/samples/connectedcup/component/agent/src/main/webapp/js/coffee.js b/modules/samples/connectedcup/component/agent/src/main/webapp/js/coffee.js index c738d217..294a15b6 100644 --- a/modules/samples/connectedcup/component/agent/src/main/webapp/js/coffee.js +++ b/modules/samples/connectedcup/component/agent/src/main/webapp/js/coffee.js @@ -19,21 +19,21 @@ var temperature = 0; var coffee_amount = 0; -function updateCoffee(newValue){ - var coffee_level = document.getElementById("coffee_level"); - coffee_level.innerHTML = newValue + "%"; - coffee_amount =newValue; +function updateCoffee(newValue) { + var coffee_level = document.getElementById('coffee_level'); + coffee_level.innerHTML = newValue + '%'; + coffee_amount = newValue; - var coffee = document.getElementById("water"); - if(newValue == 0){ - coffee.style.height= (newValue*3) + 'px'; - }else{ - coffee.style.height= (newValue*3) - 3 + 'px'; + var coffee = document.getElementById('water'); + if (newValue == 0) { + coffee.style.height = (newValue * 3) + 'px'; + } else { + coffee.style.height = (newValue * 3) - 3 + 'px'; } } -function updateTemperature(newValue){ +function updateTemperature(newValue) { temperature = newValue; - var temperature_level = document.getElementById("temperature_level"); - temperature_level.innerHTML = newValue + " C"; -} \ No newline at end of file + var temperature_level = document.getElementById('temperature_level'); + temperature_level.innerHTML = newValue + ' C'; +}