Found slider and popup dialog.

This commit is contained in:
Admin
2016-02-18 16:39:41 -06:00
parent d64a028f30
commit 8586bbd965
8 changed files with 64 additions and 25 deletions

View File

@@ -5,7 +5,7 @@
<groupId>com.bwssystems.HABridge</groupId>
<artifactId>ha-bridge</artifactId>
<version>1.3.8g</version>
<version>1.3.8h</version>
<packaging>jar</packaging>
<name>HA Bridge</name>

View File

@@ -154,21 +154,21 @@ public class BridgeSettingsDescriptor {
return true;
}
public Boolean isValidHarmony() {
if(this.getHarmonyAddress() == null)
if(this.getHarmonyAddress() == null || this.getHarmonyAddress().getDevices().size() <= 0)
return false;
List<NamedIP> devicesList = this.getHarmonyAddress().getDevices();
if(devicesList.get(0).getIp().contains(Configuration.DEFAULT_ADDRESS))
return false;
if(this.getHarmonyPwd() == null || this.getHarmonyPwd() == "")
if(this.getHarmonyPwd() == null || this.getHarmonyPwd().equals(""))
return false;
if(this.getHarmonyUser() == null || this.getHarmonyUser() == "")
if(this.getHarmonyUser() == null || this.getHarmonyUser().equals(""))
return false;
return true;
}
public Boolean isValidNest() {
if(this.getNestpwd() == null || this.getNestpwd() == "")
if(this.getNestpwd() == null || this.getNestpwd().equals(""))
return false;
if(this.getNestuser() == null || this.getNestuser() == "")
if(this.getNestuser() == null || this.getNestuser().equals(""))
return false;
return true;
}

View File

@@ -99,11 +99,12 @@ public class NestHome {
}
public void closeTheNest() {
theNest.endNestSession();
theNest = null;
theSession = null;
nestItems = null;
if(theSession != null) {
theNest.endNestSession();
theNest = null;
theSession = null;
nestItems = null;
}
}
}

View File

@@ -0,0 +1,2 @@
/*! angularjs-slider - v2.8.0 - (c) Rafal Zajac <rzajac@gmail.com>, Valentin Hervieu <valentin@hervieu.me>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com> - https://github.com/angular-slider/angularjs-slider - 2016-02-08 */
rzslider{position:relative;display:inline-block;width:100%;height:4px;margin:35px 0 15px 0;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}rzslider[disabled]{cursor:not-allowed}rzslider[disabled] .rz-pointer{cursor:not-allowed;background-color:#d8e0f3}rzslider span{position:absolute;display:inline-block;white-space:nowrap}rzslider .rz-base{width:100%;height:100%;padding:0}rzslider .rz-bar-wrapper{left:0;z-index:1;width:100%;height:32px;padding-top:16px;margin-top:-16px;box-sizing:border-box}rzslider .rz-bar-wrapper.rz-draggable{cursor:move}rzslider .rz-bar{left:0;z-index:1;width:100%;height:4px;background:#d8e0f3;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider .rz-bar.rz-selection{z-index:2;background:#0db9f0;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider .rz-pointer{top:-14px;z-index:3;width:32px;height:32px;cursor:pointer;background-color:#0db9f0;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px}rzslider .rz-pointer:after{position:absolute;top:12px;left:12px;width:8px;height:8px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;content:''}rzslider .rz-pointer:hover:after{background-color:#fff}rzslider .rz-pointer.rz-active{z-index:4}rzslider .rz-pointer.rz-active:after{background-color:#451aff}rzslider .rz-bubble{bottom:16px;padding:1px 3px;color:#55637d;cursor:default}rzslider .rz-bubble.rz-selection{top:16px}rzslider .rz-bubble.rz-limit{color:#55637d}rzslider .rz-ticks{position:absolute;top:-3px;left:0;z-index:1;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;height:0;padding:0 11px;margin:0;list-style:none;box-sizing:border-box;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}rzslider .rz-ticks .tick{width:10px;height:10px;text-align:center;cursor:pointer;background:#d8e0f3;border-radius:50%}rzslider .rz-ticks .tick.selected{background:#0db9f0}rzslider .rz-ticks .tick .tick-value{position:absolute;top:-30px;transform:translate(-50%,0)}rzslider.vertical{position:relative;width:4px;height:100%;padding:0;margin:0 20px;vertical-align:baseline}rzslider.vertical .rz-base{width:100%;height:100%;padding:0}rzslider.vertical .rz-bar-wrapper{top:auto;left:0;width:32px;height:100%;padding:0 0 0 16px;margin:0 0 0 -16px}rzslider.vertical .rz-bar{bottom:0;left:auto;width:4px;height:100%}rzslider.vertical .rz-pointer{top:auto;bottom:0;left:-14px!important}rzslider.vertical .rz-bubble{bottom:0;left:16px!important;margin-left:3px}rzslider.vertical .rz-bubble.rz-selection{top:auto;left:16px!important}rzslider.vertical .rz-ticks{top:0;left:-3px;z-index:1;width:0;height:100%;padding:11px 0;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}rzslider.vertical .rz-ticks .tick{vertical-align:middle}rzslider.vertical .rz-ticks .tick .tick-value{top:auto;right:-30px;transform:translate(0,-28%)}

View File

@@ -8,7 +8,9 @@
<link href="css/main.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/ngToast.min.css" rel="stylesheet">
<link href="css/slider.css" rel="stylesheet">
<link href="css/rzslider.min.css" rel="stylesheet">
<link href="css/ngDialog.min.css" rel="stylesheet">
<link href="css/ngDialog-theme-default.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script type="text/javascript" src="js/html5shiv.min.js"></script>
@@ -53,14 +55,14 @@
</div>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/angular-route.min.js"></script>
<script src="js/angular-sanitize.min.js"></script>
<script src="js/ngToast.min.js"></script>
<script src="js/slider.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/rzslider.min.js"></script>
<script src="js/rzslider.min.js"></script>
<script src="js/ngDialog.min.js"></script>
<script src="scripts/app.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
var app = angular.module('habridge', ['ngRoute','ngToast','ui.slider']);
var app = angular.module('habridge', ['ngRoute','ngToast','rzModule','ngDialog']);
app.config(function ($routeProvider) {
$routeProvider.when('/#', {
@@ -571,7 +571,7 @@ app.controller('SystemController', function ($scope, $location, $http, $window,
};
});
app.controller('ViewingController', function ($scope, $location, $http, $window, bridgeService) {
app.controller('ViewingController', function ($scope, $location, $http, $window, bridgeService, ngDialog) {
bridgeService.viewDevices();
bridgeService.viewBackups();
@@ -587,12 +587,20 @@ app.controller('ViewingController', function ($scope, $location, $http, $window,
$scope.reverse = ($scope.predicate === predicate) ? !$scope.reverse : false;
$scope.predicate = predicate;
};
$scope.testUrl = function (device, type) {
if(type == "on") {
}
ngDialog.open({
template: 'valueDialog',
controller: 'ValueDialogCtrl',
className: 'ngdialog-theme-default'
});
// bridgeService.testUrl(device, type);
};
$scope.deleteDevice = function (device) {
bridgeService.deleteDevice(device.id);
};
$scope.testUrl = function (device, type) {
bridgeService.testUrl(device, type);
};
$scope.editDevice = function (device) {
bridgeService.editDevice(device);
$location.path('/editdevice');
@@ -622,6 +630,20 @@ app.controller('ViewingController', function ($scope, $location, $http, $window,
};
});
app.controller('ValueDialogCtrl', function ($scope, ngDialog) {
$scope.slider = {
value: 100,
options: {
floor: 0,
ceil: 100,
showSelectionBar: true
}
};
$scope.setValue = function () {
ngDialog.close('ngdialog1');
};
});
app.controller('AddingController', function ($scope, $location, $http, bridgeService) {
$scope.bridge = bridgeService.state;
$scope.device = $scope.bridge.device;
@@ -662,7 +684,7 @@ app.controller('AddingController', function ($scope, $location, $http, bridgeSer
$scope.device.contentBodyOff = null;
$scope.bridge.olddevicename = "";
};
$scope.clearDevice();
$scope.buildUrlsUsingDevice = function (dim_control) {
if ($scope.vera.base.indexOf("http") < 0) {
$scope.vera.base = "http://" + $scope.vera.base;

View File

@@ -49,9 +49,6 @@
<button class="btn btn-danger" type="submit"
ng-click="deleteDevice(device)">Delete</button>
</p>
<p>
<slider floor="0" ceiling="100" step="1" precision="2" ng-model="devicePercentage"></slider>
</p>
</td>
</tr>
</table>
@@ -91,4 +88,17 @@
</tr>
</table>
</div>
</div>
</div>
<script type="text/ng-template" id="valueDialog">
<div class="ngdialog-message">
<h2>Select value</h2>
<p>
<rzslider rz-slider-model="slider.value" rz-slider-options="slider.options"></rzslider>
</p>
</div>
<div class="ngdialog-buttons mt">
<button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="setValue()">Set</button>
</div>
</script>