2020-10-06 02:59:44 +08:00
|
|
|
function generateVideoResponse( data, responseText ) {
|
|
|
|
console.log(data);
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2020-10-06 02:59:44 +08:00
|
|
|
var generated = (data.result=='Ok') ? 1 : 0;
|
|
|
|
var fullUrl = thisUrl + '?view=' + currentView + '&eid=' + eventId + '&generated=' + generated;
|
2020-10-06 04:53:46 +08:00
|
|
|
|
2020-10-06 02:59:44 +08:00
|
|
|
$j('#videoProgress').removeClass( 'text-warning' );
|
|
|
|
if ( generated ) {
|
|
|
|
$j('#videoProgress').addClass( 'text-success' );
|
|
|
|
$j('#videoProgress').text(exportSucceededString);
|
|
|
|
$j( "#videoTable" ).load( fullUrl+ ' #videoTable' );
|
2019-01-19 23:32:40 +08:00
|
|
|
} else {
|
2020-10-06 02:59:44 +08:00
|
|
|
$j('#videoProgress').addClass( 'text-danger' );
|
|
|
|
$j('#videoProgress').text(exportFailedString);
|
2019-01-19 23:32:40 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2020-02-29 22:28:04 +08:00
|
|
|
function generateVideo() {
|
2020-10-05 22:37:00 +08:00
|
|
|
var form = $j('#videoForm').serialize();
|
|
|
|
$j.getJSON(thisUrl + '?view=request&request=event&action=video', form)
|
|
|
|
.done(generateVideoResponse)
|
|
|
|
.fail(logAjaxFail);
|
2020-10-06 02:59:44 +08:00
|
|
|
$j('#videoProgress').removeClass('invisible');
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
2020-10-06 04:44:07 +08:00
|
|
|
|
|
|
|
function initPage() {
|
|
|
|
var backBtn = $j('#backBtn');
|
|
|
|
var videoBtn = $j('#videoBtn');
|
|
|
|
|
|
|
|
videoBtn.prop('disabled', !opt_ffmpeg);
|
2020-10-06 05:31:26 +08:00
|
|
|
|
2020-10-06 04:44:07 +08:00
|
|
|
// Manage the BACK button
|
|
|
|
document.getElementById("backBtn").addEventListener("click", function onBackClick(evt) {
|
|
|
|
evt.preventDefault();
|
|
|
|
window.history.back();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Manage the REFRESH Button
|
|
|
|
document.getElementById("refreshBtn").addEventListener("click", function onRefreshClick(evt) {
|
|
|
|
evt.preventDefault();
|
|
|
|
window.location.reload(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
// Don't enable the back button if there is no previous zm page to go back to
|
|
|
|
backBtn.prop('disabled', !document.referrer.length);
|
|
|
|
}
|
|
|
|
|
|
|
|
$j(document).ready(initPage);
|