Merge branch 'continuous' into cont_mast
This commit is contained in:
commit
f3ea08c4a1
|
@ -122,7 +122,16 @@ function controlPanTilt($monitor, $cmds) {
|
||||||
$hasTilt = $control->CanTilt();
|
$hasTilt = $control->CanTilt();
|
||||||
$hasDiag = $hasPan && $hasTilt && $control->CanMoveDiag();
|
$hasDiag = $hasPan && $hasTilt && $control->CanMoveDiag();
|
||||||
?>
|
?>
|
||||||
<button type="button" class="arrowBtn upLeftBtn<?php echo $hasDiag?'':' invisible' ?>" data-on-click="controlCmd" value="<?php echo $cmds['MoveUpLeft'] ?>" data-xtell="-1" data-ytell="-1"></button>
|
<button type="button" class="arrowBtn upLeftBtn<?php echo $hasDiag?'':' invisible' ?>"
|
||||||
|
<?php
|
||||||
|
if ($control->CanMoveCon()) {
|
||||||
|
echo 'data-on-mousedown="controlCmd" ';
|
||||||
|
echo 'data-on-mouseup="controlCmd" ';
|
||||||
|
} else {
|
||||||
|
echo 'data-on-click="controlCmd" ';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
value="<?php echo $cmds['MoveUpLeft'] ?>" data-xtell="-1" data-ytell="-1"></button>
|
||||||
<button type="button" class="arrowBtn upBtn<?php echo $hasTilt?'':' invisible' ?>" data-on-click="controlCmd" value="<?php echo $cmds['MoveUp'] ?>" data-xtell="0" data-ytell="-1"></button>
|
<button type="button" class="arrowBtn upBtn<?php echo $hasTilt?'':' invisible' ?>" data-on-click="controlCmd" value="<?php echo $cmds['MoveUp'] ?>" data-xtell="0" data-ytell="-1"></button>
|
||||||
<button type="button" class="arrowBtn upRightBtn<?php echo $hasDiag?'':' invisible' ?>" data-on-click="controlCmd" value="<?php echo $cmds['MoveUpRight'] ?>" data-xtell="1" data-ytell="-1"></button>
|
<button type="button" class="arrowBtn upRightBtn<?php echo $hasDiag?'':' invisible' ?>" data-on-click="controlCmd" value="<?php echo $cmds['MoveUpRight'] ?>" data-xtell="1" data-ytell="-1"></button>
|
||||||
<button type="button" class="arrowBtn leftBtn<?php echo $hasPan?'':' invisible' ?>" data-on-click="controlCmd" value="<?php echo $cmds['MoveLeft'] ?>" data-xtell="-1" data-ytell="0"></button>
|
<button type="button" class="arrowBtn leftBtn<?php echo $hasPan?'':' invisible' ?>" data-on-click="controlCmd" value="<?php echo $cmds['MoveLeft'] ?>" data-xtell="-1" data-ytell="0"></button>
|
||||||
|
|
|
@ -126,6 +126,29 @@ function dataOnClick() {
|
||||||
window[fnName](ev);
|
window[fnName](ev);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
document.querySelectorAll("button[data-on-mousedown]").forEach(function(el) {
|
||||||
|
var fnName = el.getAttribute("data-on-mousedown");
|
||||||
|
if ( !window[fnName] ) {
|
||||||
|
console.error("Nothing found to bind to " + fnName + " on element " + el.name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
el.onmousedown = function(ev) {
|
||||||
|
window[fnName](ev);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
document.querySelectorAll("button[data-on-mouseup]").forEach(function(el) {
|
||||||
|
var fnName = el.getAttribute("data-on-mouseup");
|
||||||
|
if ( !window[fnName] ) {
|
||||||
|
console.error("Nothing found to bind to " + fnName + " on element " + el.name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
el.onmouseup = function(ev) {
|
||||||
|
window[fnName](ev);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'data-on-click-true' calls the global function in the attribute value with no arguments when a click happens.
|
// 'data-on-click-true' calls the global function in the attribute value with no arguments when a click happens.
|
||||||
|
|
|
@ -619,7 +619,15 @@ function getControlResponse(respObj, respText) {
|
||||||
|
|
||||||
function controlCmd(event) {
|
function controlCmd(event) {
|
||||||
button = event.target;
|
button = event.target;
|
||||||
control = button.getAttribute('value');
|
|
||||||
|
console.log(event);
|
||||||
|
if (event.type !='mouseup') {
|
||||||
|
control = button.getAttribute('value');
|
||||||
|
} else {
|
||||||
|
console.log('stop');
|
||||||
|
console.log(event);
|
||||||
|
control = 'moveStop';
|
||||||
|
}
|
||||||
xtell = button.getAttribute('data-xtell');
|
xtell = button.getAttribute('data-xtell');
|
||||||
ytell = button.getAttribute('data-ytell');
|
ytell = button.getAttribute('data-ytell');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue