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) { api('getPresets', {}, function(response) {
presets = response.result.presets presets = response.result.presets
var id = 1 var id = 1
$('<br>').appendTo($(ptz))
presetSelect(true).on({ presetSelect(true).on({
change: event => { change: event => {
id = parseInt(event.target.value) id = parseInt(event.target.value)
var preset = getPreset(id) var preset = getPreset(id)
name.val(preset ? preset.name : '') name.val(preset ? preset.name : '')
} }
}).appendTo($('body')) }).appendTo($(ptz))
$('<button>').html('Go') $('<button>').html('Go')
.appendTo($('body')).on({ .appendTo($(ptz)).on({
click: function() { click: function() {
api('camera', { api('camera', {
'fast_preset': {id: id} '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) name.val(getPreset(id).name)
$('<button>').html('Set') $('<button>').html('Set')
.appendTo($('body')).on({ .appendTo($(ptz)).on({
click: function() { click: function() {
var data = {} var data = {}
if (name.val().length) { if (name.val().length) {

View File

@ -25,7 +25,7 @@
<script src="/static/js/cccc.js"></script> <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>
<div> <div>
<button data-direction="LEFT_UP"></button> <button data-direction="LEFT_UP"></button>
@ -47,9 +47,9 @@
<button data-direction="IN">zoom in</button> <button data-direction="IN">zoom in</button>
<button data-direction="OUT">zoom out</button> <button data-direction="OUT">zoom out</button>
<br> <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> <br>
Duration: <input name="duration" value="4"></input>
</div> </div>
<script> <script>