From: erickson Date: Wed, 4 Oct 2006 22:40:29 +0000 (+0000) Subject: added object specific version of grep X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=740f0f83aecacff1d17f900538093131a728cc11;p=Evergreen.git added object specific version of grep git-svn-id: svn://svn.open-ils.org/ILS/trunk@6387 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/common/js/utils.js b/Open-ILS/web/opac/common/js/utils.js index ea293b5bdd..27653aef4a 100644 --- a/Open-ILS/web/opac/common/js/utils.js +++ b/Open-ILS/web/opac/common/js/utils.js @@ -289,6 +289,19 @@ function grep( arr, func ) { return null; } +function ogrep( obj, func ) { + var results = {}; + var found = false; + for( var i in obj ) { + if( func(obj[i]) ) { + results[i] = obj[i]; + found = true; + } + } + if(found) return results; + return null; +} + function doSelectorActions(sel) { if(IE && sel) { sel.onchange = function() { @@ -644,7 +657,7 @@ function debugFMObject(obj) { keys.sort(); for( var i = 0; i < keys.length; i++ ) { var key = keys[i]; - while( key.length < 20 ) key += ' '; + while( key.length < 12 ) key += ' '; var val = obj[keys[i]](); if( typeof val == 'object' ) { _debug(key+' :=\n');