zoneminder/web/skins/classic/views/js/devices.js

41 lines
916 B
JavaScript
Raw Normal View History

2017-05-19 01:50:56 +08:00
function switchDeviceOn( element, key ) {
var form = element.form;
form.view.value = currentView;
form.action.value = 'device';
form.command.value = 'on';
form.key.value = key;
form.submit();
}
2017-05-19 01:50:56 +08:00
function switchDeviceOff( element, key ) {
var form = element.form;
form.view.value = currentView;
form.action.value = 'device';
form.command.value = 'off';
form.key.value = key;
form.submit();
}
2017-05-19 01:50:56 +08:00
function deleteDevice( element ) {
var form = element.form;
form.view.value = currentView;
form.action.value = 'delete';
form.submit();
}
2017-05-19 01:50:56 +08:00
function configureButtons( element, name ) {
var form = element.form;
var checked = false;
for (var i = 0; i < form.elements.length; i++) {
if ( form.elements[i].name.indexOf(name) == 0) {
if ( form.elements[i].checked ) {
checked = true;
break;
}
}
2017-05-19 01:50:56 +08:00
}
form.deleteBtn.disabled = !checked;
}
window.focus();