From f071ce0d840d3cc19316119351f51b380abc71d0 Mon Sep 17 00:00:00 2001 From: charitha Date: Sat, 23 Jul 2016 10:51:14 +0530 Subject: [PATCH 1/3] 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'; +} From 66470f145bf8492f18aba7101834c1eec9afa42c Mon Sep 17 00:00:00 2001 From: charitha Date: Sat, 23 Jul 2016 11:14:59 +0530 Subject: [PATCH 2/3] Fix issues mentioned in PR https://github.com/wso2/product-iots/pull/118 --- .../analytics-view.hbs | 3 +- .../analytics-view.js | 24 ++-- .../public/js/connectedcup.js | 110 +++++++++--------- .../device-view.hbs | 2 +- .../device-view.js | 23 ++-- .../analytics-view.js | 17 ++- .../public/js/device-stats.js | 22 ++-- .../public/js/moment.min.js | 18 --- .../public/js/download.js | 56 ++++----- .../public/js/jquery.validate.js | 18 --- 10 files changed, 127 insertions(+), 166 deletions(-) diff --git a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.hbs b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.hbs index 9632b931..9907fa26 100644 --- a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.hbs +++ b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/analytics-view.hbs @@ -1,4 +1,3 @@ -