move around

This commit is contained in:
j 2020-12-05 13:08:57 +01:00
parent 6239736574
commit 32e6b5ba51
2 changed files with 10 additions and 7 deletions

View File

@ -699,15 +699,16 @@ function init_ptz() {
api('getPresets', {}, function(response) {
presets = response.result.presets
var id = 1
$('<br>').appendTo($(ptz))
presetSelect(true).on({
change: event => {
id = parseInt(event.target.value)
var preset = getPreset(id)
name.val(preset ? preset.name : '')
}
}).appendTo($('body'))
}).appendTo($(ptz))
$('<button>').html('Go')
.appendTo($('body')).on({
.appendTo($(ptz)).on({
click: function() {
api('camera', {
'fast_preset': {id: id}
@ -716,10 +717,12 @@ function init_ptz() {
})
}
})
var name = $('<input>').appendTo($('body'))
$('<br>').appendTo($(ptz))
$('<br>').appendTo($(ptz))
var name = $('<input>').appendTo($(ptz))
name.val(getPreset(id).name)
$('<button>').html('Set')
.appendTo($('body')).on({
.appendTo($(ptz)).on({
click: function() {
var data = {}
if (name.val().length) {

View File

@ -25,7 +25,7 @@
<script src="/static/js/cccc.js"></script>
<div id="ptz" style="width: 256px;text-align: center;">
<div id="ptz" style="width: 280px;text-align: center;">
<div>
<div>
<button data-direction="LEFT_UP"></button>
@ -47,9 +47,9 @@
<button data-direction="IN">zoom in</button>
<button data-direction="OUT">zoom out</button>
<br>
Speed: <input name="speed" value="1"></input>
Speed: <input name="speed" value="1" style="width:10px"></input>
Duration: <input name="duration" value="4" style="width:10px"></input>
<br>
Duration: <input name="duration" value="4"></input>
</div>
<script>