pari: branch 2.0 r4226 - in /branches/2.0/config: ./ js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Nov 26 11:56:58 CST 2008


Author: pari
Date: Wed Nov 26 11:56:57 2008
New Revision: 4226

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4226
Log:

More changes to astman.js to make sure it can be used with configure_gui.html



Modified:
    branches/2.0/config/configure_gui.html
    branches/2.0/config/js/astman.js

Modified: branches/2.0/config/configure_gui.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/configure_gui.html?view=diff&rev=4226&r1=4225&r2=4226
==============================================================================
--- branches/2.0/config/configure_gui.html (original)
+++ branches/2.0/config/configure_gui.html Wed Nov 26 11:56:57 2008
@@ -22,7 +22,7 @@
 <script src="js/astman.js"></script>
 <script>
 
-var PINGINTERVAL = 30 * 1000 ; // 30 seconds
+var PINGINTERVAL = 10 * 1000 ;
 
 var keepPinging = function(){
 	var makePingRequest = function(){
@@ -39,6 +39,7 @@
 			error: function(){}
 		});
 	};
+	makePingRequest();
 	KEEPPINGING = setInterval( makePingRequest, PINGINTERVAL);
 };
 

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=4226&r1=4225&r2=4226
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Wed Nov 26 11:56:57 2008
@@ -2601,10 +2601,10 @@
 	if( params.action == "updateconfig" ){
 		params.srcfilename = params.filename;
 		params.dstfilename = params.filename;
-		if(top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
+		if(top.sessionData && top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
 		delete params.filename;
 	}else{
-		if(top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
+		if(top.sessionData && top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
 	}
 
 	$.get(ASTGUI.paths.rawman, params, cb);
@@ -2612,7 +2612,7 @@
 
 var makeSyncRequest = function( params){ // for making synchronus requests
 	// usage ::  makeSyncRequest ( { action :'getconfig', filename: 'something.conf' } ) // no need for call back function
-	if(top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
+	if(top.sessionData && top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
 	var s = $.ajax({ url: ASTGUI.paths.rawman, data: params , async: false });
 	return s.responseText;
 };
@@ -3002,29 +3002,30 @@
 
 (function(){
 	var onload_doThese = function(){
-		window.onerror = function(err, url, errcode ){ // Log any errors on this page
-			var msg = 'ErrorCode / LineNumber : ' + errcode  + '<BR> Error : ' + err + '<BR> Location: ' + url ;
-			ASTGUI.Log.Error(msg);
-			ASTGUI.dialog.hide();
-			if( top.sessionData && top.sessionData.DEBUG_MODE ){ // show alerts only in debug mode
-				var alertmsg = 'ErrorCode / LineNumber : ' + errcode  + '\n Error : ' + err + '\n Location: ' + url ;
-				alert(alertmsg);
-			}
-			if ( jQuery.browser.msie ){ // If critical error in IE , reload entire GUI
-				top.window.reload();
-			}
-			return true;
-		};
-
-		ASTGUI.showToolTips(); // Load any tooltips in this page
-		try{
-			if( window.jQuery ){
-				$().ajaxStart( function(){ parent.document.getElementById('ajaxstatus').style.display = ''; });
+		if( top.sessionData ){
+			window.onerror = function(err, url, errcode ){ // Log any errors on this page
+				var msg = 'ErrorCode / LineNumber : ' + errcode  + '<BR> Error : ' + err + '<BR> Location: ' + url ;
+				ASTGUI.Log.Error(msg);
+				ASTGUI.dialog.hide();
+				if( top.sessionData && top.sessionData.DEBUG_MODE ){ // show alerts only in debug mode
+					var alertmsg = 'ErrorCode / LineNumber : ' + errcode  + '\n Error : ' + err + '\n Location: ' + url ;
+					alert(alertmsg);
+				}
+				if ( jQuery.browser.msie ){ // If critical error in IE , reload entire GUI
+					top.window.reload();
+				}
+				return true;
+			};
+			ASTGUI.showToolTips(); // Load any tooltips in this page
+
+			var AJS = parent.document.getElementById('ajaxstatus') ;
+			if( window.jQuery && AJS ){
+				$().ajaxStart( function(){ AJS.style.display = ''; });
 				$().ajaxStop( function(){
-					setTimeout( function(){parent.document.getElementById('ajaxstatus').style.display = 'none';}, 500 );
+					setTimeout( function(){ AJS.style.display = 'none'; }, 500 );
 				});
 			}
-		}catch(err){}
+		}
 		if( window.localajaxinit && (typeof localajaxinit == 'function' ) ){
 			window.localajaxinit();
 		}




More information about the asterisk-gui-commits mailing list