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

38 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-02-29 22:28:04 +08:00
function deleteVideo(e) {
index = e.getAttribute('data-file-index');
2020-02-29 22:28:04 +08:00
window.location.replace(thisUrl+'?view='+currentView+'&eid='+eventId+'&deleteIndex='+index);
}
2020-02-29 22:28:04 +08:00
function downloadVideo(e) {
index = e.getAttribute('data-file-index');
2020-02-29 22:28:04 +08:00
window.location.replace(thisUrl+'?view='+currentView+'&eid='+eventId+'&downloadIndex='+index);
}
var generateVideoTimer = null;
2017-05-19 01:50:56 +08:00
function generateVideoProgress() {
var tickerText = $('videoProgressTicker').get('text');
if ( tickerText.length < 1 || tickerText.length > 4 ) {
2020-02-29 22:28:04 +08:00
$('videoProgressTicker').set('text', '.');
} else {
2020-02-29 22:28:04 +08:00
$('videoProgressTicker').appendText('.');
}
}
2017-05-19 01:50:56 +08:00
function generateVideoResponse( respObj, respText ) {
2020-02-29 22:28:04 +08:00
window.location.replace(thisUrl+'?view='+currentView+'&eid='+eventId+'&generated='+((respObj.result=='Ok')?1:0));
}
2020-03-10 02:43:54 +08:00
function generateVideo() {
form = $j('#contentForm')[0];
2017-05-19 01:50:56 +08:00
var parms = 'view=request&request=event&action=video';
parms += '&'+$(form).toQueryString();
2020-02-29 22:28:04 +08:00
var query = new Request.JSON({url: thisUrl, method: 'post', data: parms, onSuccess: generateVideoResponse});
2017-05-19 01:50:56 +08:00
query.send();
2020-02-29 22:28:04 +08:00
$('videoProgress').removeClass('hidden');
$('videoProgress').setProperty('class', 'warnText');
$('videoProgressText').set('text', videoGenProgressString);
2017-05-19 01:50:56 +08:00
generateVideoProgress();
2020-02-29 22:28:04 +08:00
generateVideoTimer = generateVideoProgress.periodical(500);
}