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

38 lines
1.3 KiB
JavaScript
Raw Normal View History

function deleteVideo( e ) {
index = e.getAttribute('data-file-index');
2017-05-19 01:50:56 +08:00
window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&deleteIndex='+index );
}
function downloadVideo( e ) {
index = e.getAttribute('data-file-index');
2017-05-19 01:50:56 +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 ) {
2017-05-19 01:50:56 +08:00
$('videoProgressTicker').set( 'text', '.' );
} else {
2017-05-19 01:50:56 +08:00
$('videoProgressTicker').appendText( '.' );
}
}
2017-05-19 01:50:56 +08:00
function generateVideoResponse( respObj, respText ) {
window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&generated='+((respObj.result=='Ok')?1:0) );
}
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();
var query = new Request.JSON( {url: thisUrl, method: 'post', data: parms, onSuccess: generateVideoResponse} );
2017-05-19 01:50:56 +08:00
query.send();
$('videoProgress').removeClass( 'hidden' );
$('videoProgress').setProperty( 'class', 'warnText' );
$('videoProgressText').set( 'text', videoGenProgressString );
generateVideoProgress();
generateVideoTimer = generateVideoProgress.periodical( 500 );
}