Further mootools mods and slightly enlarged event view
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2836 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
93d1cf8ed2
commit
dc42b4a83b
|
@ -46,7 +46,7 @@ var popupSizes = {
|
||||||
'device': { 'width': 260, 'height': 150 },
|
'device': { 'width': 260, 'height': 150 },
|
||||||
'devices': { 'width': 400, 'height': 240 },
|
'devices': { 'width': 400, 'height': 240 },
|
||||||
'donate': { 'width': 500, 'height': 280 },
|
'donate': { 'width': 500, 'height': 280 },
|
||||||
'event': { 'addWidth': 96, 'minWidth': 480, 'addHeight': 200, minHeight: 540 },
|
'event': { 'addWidth': 108, 'minWidth': 496, 'addHeight': 200, minHeight: 540 },
|
||||||
'eventdetail': { 'width': 400, 'height': 220 },
|
'eventdetail': { 'width': 400, 'height': 220 },
|
||||||
'events': { 'width': 760, 'height': 480 },
|
'events': { 'width': 760, 'height': 480 },
|
||||||
'export': { 'width': 400, 'height': 340 },
|
'export': { 'width': 400, 'height': 340 },
|
||||||
|
|
|
@ -320,8 +320,6 @@ function updateStillsSizes()
|
||||||
{
|
{
|
||||||
var containerDim = $('eventThumbs').getStyles( 'width', 'height' );
|
var containerDim = $('eventThumbs').getStyles( 'width', 'height' );
|
||||||
var popupDim = $('eventImageFrame').getStyles( 'width', 'height' );
|
var popupDim = $('eventImageFrame').getStyles( 'width', 'height' );
|
||||||
console.log( containerDim );
|
|
||||||
console.log( popupDim );
|
|
||||||
|
|
||||||
var containerWidth = containerDim.width.match( /^\d+/ );
|
var containerWidth = containerDim.width.match( /^\d+/ );
|
||||||
var containerHeight = containerDim.height.match( /^\d+/ );
|
var containerHeight = containerDim.height.match( /^\d+/ );
|
||||||
|
@ -335,8 +333,6 @@ function updateStillsSizes()
|
||||||
var top = (containerHeight - popupHeight)/2;
|
var top = (containerHeight - popupHeight)/2;
|
||||||
if ( top < 0 ) top = 0;
|
if ( top < 0 ) top = 0;
|
||||||
|
|
||||||
console.log( "Top: "+top+", Left: "+left );
|
|
||||||
|
|
||||||
$('eventImagePanel').setStyles( {
|
$('eventImagePanel').setStyles( {
|
||||||
'left': left,
|
'left': left,
|
||||||
'top': top
|
'top': top
|
||||||
|
@ -345,7 +341,7 @@ function updateStillsSizes()
|
||||||
|
|
||||||
function loadEventImage( event, frame )
|
function loadEventImage( event, frame )
|
||||||
{
|
{
|
||||||
console.log( "Loading "+event.Id+"/"+frame.FrameId );
|
console.debug( "Loading "+event.Id+"/"+frame.FrameId );
|
||||||
var eventImg = $('eventImage');
|
var eventImg = $('eventImage');
|
||||||
var thumbImg = $('eventThumb'+frame.FrameId);
|
var thumbImg = $('eventThumb'+frame.FrameId);
|
||||||
if ( eventImg.getProperty( 'src' ) != thumbImg.getProperty( 'src' ) )
|
if ( eventImg.getProperty( 'src' ) != thumbImg.getProperty( 'src' ) )
|
||||||
|
@ -379,7 +375,7 @@ function loadEventImage( event, frame )
|
||||||
eventImagePanel.setOpacity( 0 );
|
eventImagePanel.setOpacity( 0 );
|
||||||
updateStillsSizes();
|
updateStillsSizes();
|
||||||
eventImagePanel.setStyle( 'display', 'block' );
|
eventImagePanel.setStyle( 'display', 'block' );
|
||||||
new Fx.Style( eventImagePanel, 'opacity',{ duration: 500, transition: Fx.Transitions.sineInOut } ).start( 0, 1 );
|
new Fx.Tween( eventImagePanel, { duration: 500, transition: Fx.Transitions.Sine } ).start( 'opacity', 0, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
$('eventImageNo').set( 'text', frame.FrameId );
|
$('eventImageNo').set( 'text', frame.FrameId );
|
||||||
|
@ -403,7 +399,7 @@ function hideEventImageComplete()
|
||||||
function hideEventImage()
|
function hideEventImage()
|
||||||
{
|
{
|
||||||
if ( $('eventImagePanel').getStyle( 'display' ) != 'none' )
|
if ( $('eventImagePanel').getStyle( 'display' ) != 'none' )
|
||||||
new Fx.Style( $('eventImagePanel'), 'opacity',{ duration: 500, transition: Fx.Transitions.sineInOut, onSuccess: hideEventImageComplete } ).start( 1, 0 );
|
new Fx.Tween( $('eventImagePanel'), { duration: 500, transition: Fx.Transitions.Sine, onComplete: hideEventImageComplete } ).start( 'opacity', 1, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetEventStills()
|
function resetEventStills()
|
||||||
|
@ -417,17 +413,13 @@ function resetEventStills()
|
||||||
onChange: function( step )
|
onChange: function( step )
|
||||||
{
|
{
|
||||||
var fid = step + 1;
|
var fid = step + 1;
|
||||||
console.log( 'FID:'+step );
|
|
||||||
checkFrames( event.Id, fid );
|
checkFrames( event.Id, fid );
|
||||||
scroll.toElement( 'eventThumb'+fid );
|
scroll.toElement( 'eventThumb'+fid );
|
||||||
}
|
}
|
||||||
} ).set( 0 );
|
} ).set( 0 );
|
||||||
}
|
}
|
||||||
console.log( "H1: "+$('eventThumbs').getStyle( 'height' ).match( /^\d+/ ) );
|
|
||||||
console.log( "H2 :"+(event.Height+80) );
|
|
||||||
if ( $('eventThumbs').getStyle( 'height' ).match( /^\d+/ ) < (parseInt(event.Height)+80) )
|
if ( $('eventThumbs').getStyle( 'height' ).match( /^\d+/ ) < (parseInt(event.Height)+80) )
|
||||||
{
|
{
|
||||||
console.log( "Resizing" );
|
|
||||||
$('eventThumbs').setStyle( 'height', (parseInt(event.Height)+80)+'px' );
|
$('eventThumbs').setStyle( 'height', (parseInt(event.Height)+80)+'px' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -436,8 +428,6 @@ function getFrameResponse( respObj, respText )
|
||||||
{
|
{
|
||||||
var frame = respObj.frameimage;
|
var frame = respObj.frameimage;
|
||||||
|
|
||||||
//console.log( 'Got response for frame '+frame.FrameId );
|
|
||||||
|
|
||||||
if ( !event )
|
if ( !event )
|
||||||
{
|
{
|
||||||
console.error( "No event "+frame.EventId+" found" );
|
console.error( "No event "+frame.EventId+" found" );
|
||||||
|
@ -483,10 +473,8 @@ function checkFrames( eventId, frameId, loadImage )
|
||||||
|
|
||||||
for ( var fid = loFid; fid <= hiFid; fid++ )
|
for ( var fid = loFid; fid <= hiFid; fid++ )
|
||||||
{
|
{
|
||||||
console.log( 'Checking frame '+fid );
|
|
||||||
if ( !$('eventThumb'+fid) )
|
if ( !$('eventThumb'+fid) )
|
||||||
{
|
{
|
||||||
console.log( 'Creating frame placeholder '+fid );
|
|
||||||
var img = new Element( 'img', { 'id': 'eventThumb'+fid, 'src': 'graphics/transparent.gif', 'alt': fid, 'class': 'placeholder' } );
|
var img = new Element( 'img', { 'id': 'eventThumb'+fid, 'src': 'graphics/transparent.gif', 'alt': fid, 'class': 'placeholder' } );
|
||||||
img.addEvent( 'click', function () { event['frames'][fid] = null; checkFrames( eventId, frameId ) } );
|
img.addEvent( 'click', function () { event['frames'][fid] = null; checkFrames( eventId, frameId ) } );
|
||||||
frameQuery( eventId, fid, loadImage && (fid == frameId) );
|
frameQuery( eventId, fid, loadImage && (fid == frameId) );
|
||||||
|
@ -494,7 +482,6 @@ function checkFrames( eventId, frameId, loadImage )
|
||||||
var injected = false;
|
var injected = false;
|
||||||
if ( fid < imgs.length )
|
if ( fid < imgs.length )
|
||||||
{
|
{
|
||||||
//console.log( "Injecting "+fid+" at "+(fid-1)+", length "+imgs.length );
|
|
||||||
img.injectBefore( imgs[fid-1] );
|
img.injectBefore( imgs[fid-1] );
|
||||||
injected = true;
|
injected = true;
|
||||||
}
|
}
|
||||||
|
@ -505,7 +492,6 @@ function checkFrames( eventId, frameId, loadImage )
|
||||||
{
|
{
|
||||||
if ( parseInt(img.getProperty( 'alt' )) < parseInt(thumbImg.getProperty( 'alt' )) )
|
if ( parseInt(img.getProperty( 'alt' )) < parseInt(thumbImg.getProperty( 'alt' )) )
|
||||||
{
|
{
|
||||||
//console.log( "Injecting "+fid+" at index "+index+", length "+imgs.length );
|
|
||||||
img.injectBefore( thumbImg );
|
img.injectBefore( thumbImg );
|
||||||
return( true );
|
return( true );
|
||||||
}
|
}
|
||||||
|
@ -515,7 +501,6 @@ function checkFrames( eventId, frameId, loadImage )
|
||||||
}
|
}
|
||||||
if ( !injected )
|
if ( !injected )
|
||||||
{
|
{
|
||||||
//console.log( "Injecting "+fid+", length "+imgs.length );
|
|
||||||
img.injectInside( $('eventThumbs') );
|
img.injectInside( $('eventThumbs') );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue