replace embedded popuplinks in watch view

pull/3065/head
Andrew Bauer 2020-10-12 13:26:20 -05:00
parent 332ec2032a
commit e5e1455f7a
2 changed files with 12 additions and 40 deletions

View File

@ -233,46 +233,22 @@ window.addEventListener("DOMContentLoaded", function onSkinDCL() {
}); });
}); });
function createEventPopup( eventId, eventFilter, width, height ) { function openEvent( eventId, eventFilter ) {
var url = '?view=event&eid='+eventId; var url = '?view=event&eid='+eventId;
if ( eventFilter ) { if ( eventFilter ) {
url += eventFilter; url += eventFilter;
} }
var name = 'zmEvent'; window.location.assign(url);
var popupSize = getPopupSize( 'event', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus();
}
} }
function createFramesPopup( eventId, width, height ) { function openFrames( eventId ) {
var url = '?view=frames&eid='+eventId; var url = '?view=frames&eid='+eventId;
var name = 'zmFrames'; window.location.assign(url);
var popupSize = getPopupSize( 'frames', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus();
}
} }
function createFramePopup( eventId, frameId, width, height ) { function openFrame( eventId, frameId, width, height ) {
var url = '?view=frame&eid='+eventId+'&fid='+frameId; var url = '?view=frame&eid='+eventId+'&fid='+frameId;
var name = 'zmFrame'; window.location.assign(url);
var popupSize = getPopupSize( 'frame', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus();
}
} }
function windowToFront() { function windowToFront() {

View File

@ -562,11 +562,9 @@ function getEventCmdResponse( respObj, respText ) {
var link = new Element('a', { var link = new Element('a', {
'href': '#', 'href': '#',
'events': { 'events': {
'click': createEventPopup.pass( [ 'click': openEvent.pass( [
zm_event.Id, zm_event.Id,
'&filter[Query][terms][0][attr]=MonitorId&filter[Query][terms][0][op]=%3d&filter[Query][terms][0][val]='+monitorId+'&page=1&popup=1', '&filter[Query][terms][0][attr]=MonitorId&filter[Query][terms][0][op]=%3d&filter[Query][terms][0][val]='+monitorId+'&page=1'
zm_event.Width,
zm_event.Height
] ) ] )
} }
}); });
@ -576,11 +574,9 @@ function getEventCmdResponse( respObj, respText ) {
link = new Element('a', { link = new Element('a', {
'href': '#', 'href': '#',
'events': { 'events': {
'click': createEventPopup.pass( [ 'click': openEvent.pass( [
zm_event.Id, zm_event.Id,
'&filter[Query][terms][0][attr]=MonitorId&filter[Query][terms][0][op]=%3d&filter[Query][terms][0][val]='+monitorId+'&page=1&popup=1', '&filter[Query][terms][0][attr]=MonitorId&filter[Query][terms][0][op]=%3d&filter[Query][terms][0][val]='+monitorId+'&page=1'
zm_event.Width,
zm_event.Height
] ) ] )
} }
}); });
@ -590,11 +586,11 @@ function getEventCmdResponse( respObj, respText ) {
row.getElement('td.colTime').set('text', zm_event.StartTime); row.getElement('td.colTime').set('text', zm_event.StartTime);
row.getElement('td.colSecs').set('text', zm_event.Length); row.getElement('td.colSecs').set('text', zm_event.Length);
link = new Element('a', {'href': '#', 'events': {'click': createFramesPopup.pass( [zm_event.Id, zm_event.Width, zm_event.Height] )}}); link = new Element('a', {'href': '#', 'events': {'click': openFrames.pass( [zm_event.Id] )}});
link.set('text', zm_event.Frames+'/'+zm_event.AlarmFrames); link.set('text', zm_event.Frames+'/'+zm_event.AlarmFrames);
link.inject(row.getElement('td.colFrames')); link.inject(row.getElement('td.colFrames'));
link = new Element('a', {'href': '#', 'events': {'click': createFramePopup.pass( [zm_event.Id, '0', zm_event.Width, zm_event.Height] )}}); link = new Element('a', {'href': '#', 'events': {'click': openFrame.pass( [zm_event.Id, '0'] )}});
link.set('text', zm_event.AvgScore+'/'+zm_event.MaxScore); link.set('text', zm_event.AvgScore+'/'+zm_event.MaxScore);
link.inject(row.getElement('td.colScore')); link.inject(row.getElement('td.colScore'));