You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by sm...@apache.org on 2006/12/09 06:09:03 UTC
svn commit: r484922 -
/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js
Author: smilek
Date: Fri Dec 8 21:09:02 2006
New Revision: 484922
URL: http://svn.apache.org/viewvc?view=rev&rev=484922
Log:
add optional args to jetspeed.printobj
Modified:
portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js
Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js?view=diff&rev=484922&r1=484921&r2=484922
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js Fri Dec 8 21:09:02 2006
@@ -111,14 +111,24 @@
}
};
-jetspeed.printobj = function( obj, omitLineBreaks )
+jetspeed.printobj = function( obj, omitLineBreaks, omitEmptyValsProperties, arrayLengthsOnly )
{
var props = [];
for( var prop in obj )
{
try
{
- props.push( prop + ': ' + obj[prop] );
+ var propVal = obj[prop];
+ if ( arrayLengthsOnly )
+ {
+ if ( dojo.lang.isArray( propVal ) )
+ {
+ propVal = "[" + propVal.length + "]";
+ }
+ }
+ propVal = propVal + "";
+ if ( ! omitEmptyValsProperties || propVal.length > 0 )
+ props.push( prop + ': ' + propVal );
}
catch(E)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org