iobroker.alexa-timer-vis
Version:
Alexa Timer ausgeben um in der Vis anzuzeigen
118 lines (95 loc) • 3.88 kB
HTML
<html>
<head>
<!-- Load ioBroker scripts and styles-->
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
<!-- Load our own files -->
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="words.js"></script>
<script type="text/javascript">
// This will be called by the admin adapter when the settings page loads
function load(settings, onChange) {
// example: select elements with id=key and class=value and insert value
//var getAdminDevices = []; // For table "getAdminDevices"
if (!settings) return;
$('.value').each(function () {
var $key = $(this);
var id = $key.attr('id');
if ($key.attr('type') === 'checkbox') {
// do not call onChange direct, because onChange could expect some arguments
$key.prop('checked', settings[id])
.on('change', () => onChange())
;
} else {
// do not call onChange direct, because onChange could expect some arguments
$key.val(settings[id])
.on('change', () => onChange())
.on('keyup', () => onChange())
;
}
});
//getAdminDevices = settings.getAdminDevices || []; // For table "getAdminDevices"
onChange(false);
//values2table('getAdminDevices', getAdminDevices, onChange); // For table "getAdminDevices"
// reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
if (M) M.updateTextFields();
}
// This will be called by the admin adapter when the user presses the save button
function save(callback) {
// example: select elements with class=value and build settings object
var obj = {};
$('.value').each(function () {
var $this = $(this);
if ($this.attr('type') === 'checkbox') {
obj[$this.attr('id')] = $this.prop('checked');
} else if ($this.attr('type') === 'number') {
obj[$this.attr('id')] = parseFloat($this.val());
} else {
obj[$this.attr('id')] = $this.val();
}
});
obj.getAdminDevices = table2values('getAdminDevices');
callback(obj);
}
</script>
</head>
<body>
<div class="m adapter-container">
<div class="row">
<div class="col s12 m4 l2">
<img src="alexa-timer-vis.png" class="logo">
</div>
</div>
<!-- Put your content here -->
<!-- For example columns with settings: -->
<div class="row">
<h1 id ="headline" class="translate description">Alexa Timer für die Vis</h1>
<div class="col s4 input-field">
<input type="text" class="value input" name="option1" placeholder="Alexa2.0" id="alexa"/>
<p class="translate description">Alexa Instanze</p>
</div>
</div>
<div class="row">
<div class="col s2 input-field">
<input type="number" class="value input" name="option2" min="1" placeholder="1" id="intervall1"/><span>sec</span>
<p class="translate description">Intervall, Zeit übrig mehr als 60 sek</p>
</div>
<div class="col s2 input-field">
<input type="number" class="value input" name="option3" min="1" placeholder="1" id="intervall2"/><span>sec</span>
<p class="translate description">Intervall, Zeit übrig weniger als 60 sek</p>
</div>
<!-- <div class="col s1 input-field">
test
<input type="checkbox" class="value" name="option5" id ="option5" >
<label for="option5">checkbox</label>
</div>
-->
</div>
</div>
</body>
</html>