From 31a0762d9e3d4afee271604217758cced9aae44e Mon Sep 17 00:00:00 2001 From: stan Date: Mon, 1 Sep 2008 14:59:02 +0000 Subject: [PATCH] Fixed issues with remote method not being preserved. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2622 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/skins/classic/views/js/monitor.js | 6 +++--- web/skins/classic/views/js/monitor.js.php | 18 ++++++++++++------ web/skins/classic/views/monitor.php | 18 ++++++++++++++++-- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/web/skins/classic/views/js/monitor.js b/web/skins/classic/views/js/monitor.js index 11698562b..bf83fa7f7 100644 --- a/web/skins/classic/views/js/monitor.js +++ b/web/skins/classic/views/js/monitor.js @@ -48,9 +48,9 @@ function loadLocations( element ) function initPage() { - var protocolSelector = $('contentForm').elements['newMonitor[Protocol]']; - if ( $(protocolSelector).getTag() == 'select' ) - updateMethods( $(protocolSelector) ); + //var protocolSelector = $('contentForm').elements['newMonitor[Protocol]']; + //if ( $(protocolSelector).getTag() == 'select' ) + //updateMethods( $(protocolSelector) ); } window.addEvent( 'domready', initPage ); diff --git a/web/skins/classic/views/js/monitor.js.php b/web/skins/classic/views/js/monitor.js.php index bca3e12c6..b1f45e884 100644 --- a/web/skins/classic/views/js/monitor.js.php +++ b/web/skins/classic/views/js/monitor.js.php @@ -128,16 +128,20 @@ function updateMethods( element ) { var form = element.form; - form.elements['newMonitor[Method]'].length = 0; - switch ( form.elements['newMonitor[Protocol]'].value ) + var origMethod = form.elements['origMethod']; + var methodSelector = form.elements['newMonitor[Method]']; + methodSelector.options.length = 0; + switch ( element.value ) { case 'http' : { $value ) +foreach( $httpMethods as $value=>$label ) { ?> - form.elements['newMonitor[Method]'].options[form.elements['newMonitor[Method]'].length] = new Option( "", "" ); + methodSelector.options[methodSelector.options.length] = new Option( "", "" ); + if ( origMethod.value == "" ) + methodSelector.selectedIndex = methodSelector.options.length-1; @@ -147,10 +151,12 @@ foreach( $httpMethods as $label=>$value ) case 'rtsp' : { $value ) +foreach( $rtspMethods as $value=>$label ) { ?> - form.elements['newMonitor[Method]'].options[form.elements['newMonitor[Method]'].length] = new Option( "", "" ); + methodSelector.options[methodSelector.options.length] = new Option( "", "" ); + if ( origMethod.value == "" ) + methodSelector.selectedIndex = form.elements['newMonitor[Method]'].options.length-1; diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 8fc86bfcd..078f2578e 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -250,12 +250,13 @@ foreach ( $tabs as $name=>$value ) + - + @@ -465,7 +466,20 @@ switch ( $_REQUEST['tab'] ) { ?> - + + + + +