Fixed paths to montage css files and store layout as cookie

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2535 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2008-07-16 08:39:04 +00:00
parent 0c91ea7d50
commit f5c2733fb1
2 changed files with 11 additions and 16 deletions

View File

@ -16,8 +16,6 @@ function Monitor( index, id, connKey )
this.getStreamCmdResponse = function( respText )
{
//console.log( "Response" );
//console.log( this );
if ( this.streamCmdTimer )
this.streamCmdTimer = $clear( this.streamCmdTimer );
@ -78,8 +76,6 @@ function Monitor( index, id, connKey )
this.streamCmdQuery = function()
{
//console.log( "Query" );
//console.log( this );
//this.streamCmdReq.cancel();
this.streamCmdReq.request( this.streamCmdParms+"&command="+CMD_QUERY );
}
@ -90,14 +86,11 @@ function Monitor( index, id, connKey )
function selectLayout( element )
{
var cssFile = $(element).getValue();
console.log( cssFile );
var cssFile = skinPath+'/views/css/'+$(element).getValue();
if ( $('dynamicStyles') )
{
$('dynamicStyles').remove();
}
new Asset.css( cssFile, { id: 'dynamicStyles' } );
console.log( $('dynamicStyles') );
Cookie.set( 'zmMontageLayout', $(element).getValue(), { duration: 10*365 } );
}
var monitors = new Array();
@ -106,9 +99,7 @@ function initPage()
for ( var i = 0; i < monitorData.length; i++ )
{
monitors[i] = new Monitor( i, monitorData[i].id, monitorData[i].connKey );
//console.log( monitors[i] );
var delay = Math.round( Math.random()*statusRefreshTimeout );
console.log( "Delay: "+delay );
monitors[i].start( delay );
}
selectLayout( $('layout') );

View File

@ -61,12 +61,16 @@ foreach( dbFetchAll( $sql ) as $row )
$focusWindow = true;
$layouts = array(
'zm_html_view_montage_freeform.css' => 'Default',
'zm_html_view_montage_2wide.css' => '2-wide grid',
'zm_html_view_montage_3wide.css' => '3-wide grid',
'zm_html_view_montage_4wide.css' => '4-wide grid',
'zm_html_view_montage_3wide50enlarge.css' => '3-wide grid, scaled, enlarge on alarm',
'montage_freeform.css' => 'Default',
'montage_2wide.css' => '2-wide grid',
'montage_3wide.css' => '3-wide grid',
'montage_4wide.css' => '4-wide grid',
'montage_3wide50enlarge.css' => '3-wide grid, scaled, enlarge on alarm',
);
if ( isset($_COOKIE['zmMontageLayout']) )
$layout = $_COOKIE['zmMontageLayout'];
xhtmlHeaders(__FILE__, $SLANG['Montage'] );
?>
<body>