iobroker.netatmo-crawler
Version:
Crawls information from public netatmo stations
120 lines (101 loc) • 3.66 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
if (!settings) return;
$('.value').each(function () {
var $key = $(this);
var id = $key.attr('id');
console.log('Key:', $key, 'ID:', 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());
}
});
onChange(false);
// reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
if (M) {
M.updateTextFields();
M.textareaAutoResize($('#stationUrls'));
}
}
// 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 {
obj[$this.attr('id')] = $this.val();
}
});
callback(obj);
}
</script>
</head>
<body>
<div class="m adapter-container">
<div class="row">
<div class="col s12 m4 l2">
<img src="netatmo-crawler.png" class="logo">
</div>
</div>
<!-- Put your content here -->
<!-- For example columns with settings: -->
<div class="row">
<div class="input-field col s12">
<textarea id="stationUrls" rows="auto" class="value m materialize-textarea"></textarea>
<label for="stationUrls" class="translate">stationUrls</label>
</div>
</div>
<div class="row">
<div class="input-field col s5">
<select id="stationNameType" class="value">
<option value="counter" class="translate">stationNameTypeCounter</option>
<option value="id" class="translate">stationNameTypeId</option>
</select>
<label for="stationNameType" class="translate">stationNameType</label>
</div>
</div>
<!-- <div class="row">
<div class="col s6 input-field">
<input type="text" class="value" id="station2" />
<label for="station2" class="translate">station2</label>
</div>
</div>
<div class="row">
<div class="col s6 input-field">
<input type="text" class="value" id="station3" />
<label for="station3" class="translate">station3</label>
</div>
</div>
<div class="row">
<div class="col s6 input-field">
<input type="text" class="value" id="station4" />
<label for="station4" class="translate">station4</label>
</div>
</div> -->
</div>
</body>
</html>