pari: branch 2.0 r3686 - /branches/2.0/config/js/astman.js
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Aug 19 17:52:11 CDT 2008
Author: pari
Date: Tue Aug 19 17:52:11 2008
New Revision: 3686
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3686
Log:
* making getObjectPropertiesAsString a recursive function
* corresponding changes in debuglog function
Modified:
branches/2.0/config/js/astman.js
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=3686&r1=3685&r2=3686
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Tue Aug 19 17:52:11 2008
@@ -558,11 +558,7 @@
if(!top.sessionData.DEBUG_MODE ){ return true; }
if( typeof msg == 'object' ){
- if( ASTGUI.isArray(msg) ){
- msg = 'ARRAY : [' + msg.join(',') + ']' ;
- }else{
- msg = 'OBJECT : {' + ASTGUI.getObjectPropertiesAsString(msg) + '}' ;
- }
+ msg = 'OBJECT : ' + ASTGUI.getObjectPropertiesAsString(msg) ;
}
if(!color){ color = '#324176'; }
@@ -971,11 +967,19 @@
getObjectPropertiesAsString : function(a){ // takes an object and returns all its properties, values as a string
var ar = [];
for(var d in a){
- if(a.hasOwnProperty(d)){
- ar.push( d + ' : ' + a[d] );
- }
- }
- return ar.join(' ,');
+ if(!a.hasOwnProperty(d)){ continue; }
+
+ if( typeof a[d] == 'object' ){
+ if( ASTGUI.isArray(a[d]) ){
+ ar.push( d + ' : [' + a[d].join(',') + ']' );
+ }else{
+ ar.push( d + ' : ' + ASTGUI.getObjectPropertiesAsString(a[d]) );
+ }
+ }else{
+ ar.push(d + ' : '+ a[d]);
+ }
+ }
+ return '{' + ar.join(' ,') + '}' ;
},
getTrunkStatus : function (registry , trunkname, ttype){ // ASTGUI.getTrunkStatus (registry, trunkname);
More information about the asterisk-gui-commits
mailing list