use my bindButton function on the othe rbuttons
This commit is contained in:
parent
1b9f448aca
commit
4b5052c351
|
@ -473,7 +473,7 @@ function streamNext(action) {
|
||||||
//
|
//
|
||||||
location.replace(thisUrl + '?view=event&eid=' + nextEventId + filterQuery + sortQuery);
|
location.replace(thisUrl + '?view=event&eid=' + nextEventId + filterQuery + sortQuery);
|
||||||
return;
|
return;
|
||||||
if ( vid && ( NextEventDefVideoPath.indexOf("view_video") > 0 ) ) { //on and staying with videojs
|
if ( vid && ( NextEventDefVideoPath.indexOf('view_video') > 0 ) ) { //on and staying with videojs
|
||||||
CurEventDefVideoPath = NextEventDefVideoPath;
|
CurEventDefVideoPath = NextEventDefVideoPath;
|
||||||
eventQuery(nextEventId);
|
eventQuery(nextEventId);
|
||||||
} else if ( zmsBroke || (vid && NextEventDefVideoPath.indexOf("view_video") < 0) || NextEventDefVideoPath.indexOf("view_video") > 0) {//reload zms, leaving vjs, moving to vjs
|
} else if ( zmsBroke || (vid && NextEventDefVideoPath.indexOf("view_video") < 0) || NextEventDefVideoPath.indexOf("view_video") > 0) {//reload zms, leaving vjs, moving to vjs
|
||||||
|
@ -775,15 +775,15 @@ function handleClick( event ) {
|
||||||
// Manage the DELETE CONFIRMATION modal button
|
// Manage the DELETE CONFIRMATION modal button
|
||||||
function manageDelConfirmModalBtns() {
|
function manageDelConfirmModalBtns() {
|
||||||
document.getElementById("delConfirmBtn").addEventListener("click", function onDelConfirmClick(evt) {
|
document.getElementById("delConfirmBtn").addEventListener("click", function onDelConfirmClick(evt) {
|
||||||
if ( ! canEdit.Events ) {
|
if ( !canEdit.Events ) {
|
||||||
enoperm();
|
enoperm();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
$j.getJSON(thisUrl + '?request=events&task=delete&eids[]='+eventData.Id)
|
$j.getJSON(thisUrl + '?request=events&task=delete&eids[]='+eventData.Id)
|
||||||
.done( function(data) {
|
.done(function(data) {
|
||||||
streamNext( true );
|
streamNext(true);
|
||||||
})
|
})
|
||||||
.fail(logAjaxFail);
|
.fail(logAjaxFail);
|
||||||
});
|
});
|
||||||
|
@ -807,11 +807,11 @@ function getEvtStatsCookie() {
|
||||||
|
|
||||||
function getStat() {
|
function getStat() {
|
||||||
table.empty().append('<tbody>');
|
table.empty().append('<tbody>');
|
||||||
$j.each( eventDataStrings, function( key ) {
|
$j.each(eventDataStrings, function(key) {
|
||||||
var th = $j('<th>').addClass('text-right').text(eventDataStrings[key]);
|
var th = $j('<th>').addClass('text-right').text(eventDataStrings[key]);
|
||||||
var tdString;
|
var tdString;
|
||||||
|
|
||||||
switch (eventData[key].length ? key : 'n/a') {
|
switch ( ( eventData[key] && eventData[key].length ) ? key : 'n/a') {
|
||||||
case 'Frames':
|
case 'Frames':
|
||||||
tdString = '<a href="?view=frames&eid=' + eventData.Id + '">' + eventData[key] + '</a>';
|
tdString = '<a href="?view=frames&eid=' + eventData.Id + '">' + eventData[key] + '</a>';
|
||||||
break;
|
break;
|
||||||
|
@ -929,19 +929,19 @@ function initPage() {
|
||||||
backBtn.prop('disabled', !document.referrer.length);
|
backBtn.prop('disabled', !document.referrer.length);
|
||||||
|
|
||||||
// Manage the BACK button
|
// Manage the BACK button
|
||||||
document.getElementById("backBtn").addEventListener("click", function onBackClick(evt) {
|
bindButton('#backBtn', 'click', null, function onBackClick(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage the REFRESH Button
|
// Manage the REFRESH Button
|
||||||
document.getElementById("refreshBtn").addEventListener("click", function onRefreshClick(evt) {
|
bindButton('#refreshBtn', 'click', null, function onRefreshClick(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage the Event RENAME button
|
// Manage the Event RENAME button
|
||||||
document.getElementById("renameBtn").addEventListener("click", function onRenameClick(evt) {
|
bindButton('#renameBtn', 'click', null, function onRenameClick(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
$j.getJSON(thisUrl + '?request=modal&modal=eventrename&eid='+eventData.Id)
|
$j.getJSON(thisUrl + '?request=modal&modal=eventrename&eid='+eventData.Id)
|
||||||
.done(function(data) {
|
.done(function(data) {
|
||||||
|
@ -954,7 +954,7 @@ function initPage() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage the ARCHIVE button
|
// Manage the ARCHIVE button
|
||||||
document.getElementById("archiveBtn").addEventListener("click", function onArchiveClick(evt) {
|
bindButton('#archiveBtn', 'click', null, function onArchiveClick(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
$j.getJSON(thisUrl + '?request=events&task=archive&eids[]='+eventData.Id)
|
$j.getJSON(thisUrl + '?request=events&task=archive&eids[]='+eventData.Id)
|
||||||
.done( function(data) {
|
.done( function(data) {
|
||||||
|
@ -965,7 +965,7 @@ function initPage() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage the UNARCHIVE button
|
// Manage the UNARCHIVE button
|
||||||
document.getElementById("unarchiveBtn").addEventListener("click", function onUnarchiveClick(evt) {
|
bindButton('#unarchiveBtn', 'click', null, function onUnarchiveClick(evt) {
|
||||||
if ( ! canEdit.Events ) {
|
if ( ! canEdit.Events ) {
|
||||||
enoperm();
|
enoperm();
|
||||||
return;
|
return;
|
||||||
|
@ -980,7 +980,7 @@ function initPage() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage the EDIT button
|
// Manage the EDIT button
|
||||||
document.getElementById("editBtn").addEventListener("click", function onEditClick(evt) {
|
bindButton('#editBtn', 'click', null, function onEditClick(evt) {
|
||||||
if ( ! canEdit.Events ) {
|
if ( ! canEdit.Events ) {
|
||||||
enoperm();
|
enoperm();
|
||||||
return;
|
return;
|
||||||
|
@ -1001,13 +1001,13 @@ function initPage() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage the EXPORT button
|
// Manage the EXPORT button
|
||||||
document.getElementById("exportBtn").addEventListener("click", function onExportClick(evt) {
|
bindButton('#exportBtn', 'click', null, function onExportClick(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
window.location.assign('?view=export&eids[]='+eventData.Id);
|
window.location.assign('?view=export&eids[]='+eventData.Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage the DOWNLOAD VIDEO button
|
// Manage the DOWNLOAD VIDEO button
|
||||||
document.getElementById("downloadBtn").addEventListener("click", function onDownloadClick(evt) {
|
bindButton('#downloadBtn', 'click', null, function onDownloadClick(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
$j.getJSON(thisUrl + '?request=modal&modal=download&eids[]='+eventData.Id)
|
$j.getJSON(thisUrl + '?request=modal&modal=download&eids[]='+eventData.Id)
|
||||||
.done(function(data) {
|
.done(function(data) {
|
||||||
|
@ -1020,7 +1020,7 @@ function initPage() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage the Event STATISTICS Button
|
// Manage the Event STATISTICS Button
|
||||||
document.getElementById("statsBtn").addEventListener("click", function onStatsClick(evt) {
|
bindButton('#statsBtn', 'click', null, function onStatsClick(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
var cookie = 'zmEventStats';
|
var cookie = 'zmEventStats';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue