public/javascripts/inputex/js/widgets/json-tree-inspector.js
function(obj,parentEl) {
      
      var ul = inputEx.cn('ul', {className: 'inputEx-JsonTreeInspector'});
      
      for(var key in obj) {
         if(obj.hasOwnProperty(key)) {
            var value = obj[key];
            
            var id = Dom.generateId();
            var li = inputEx.cn('li', {id: id}, null, key+':');
            this.hash[id] = {value: value, expanded: false};
            
            
            if( lang.isObject(value) || lang.isArray(value) ) {
               if(lang.isArray(value)) {
                  li.appendChild( inputEx.cn('span', null, null, "[ "+value.length+" element"+(value.length > 1 ? 's':'')+"]" ) );
               }
               Dom.addClass(li,'collapsed');
               Event.addListener(li, 'click', this.onItemClick, this, true);
            }
            else {
               var spanContent = '';
               if( lang.isString(value) ) {
                  spanContent = '"'+inputEx.htmlEntities(value)+'"';
               }
               else {
                  if(value === null) {
                     spanContent = "null";
                  }
                  else {
                     spanContent = value.toString();
                  }
               }
               li.appendChild( inputEx.cn('span', {className: 'type-'+(value === null ? "null" : (typeof value))}, null, spanContent ) );
            }
            
            
            ul.appendChild(li);
         }
      }
      
      parentEl.appendChild(ul);
      
      return ul;
   }
function(obj,parentEl) {
      
      var ul = inputEx.cn('ul', {className: 'inputEx-JsonTreeInspector'});
      
      for(var key in obj) {
         if(obj.hasOwnProperty(key)) {
            var value = obj[key];
            
            var id = Dom.generateId();
            var li = inputEx.cn('li', {id: id}, null, key+':');
            this.hash[id] = {value: value, expanded: false};
            
            
            if( lang.isObject(value) || lang.isArray(value) ) {
               if(lang.isArray(value)) {
                  li.appendChild( inputEx.cn('span', null, null, "[ "+value.length+" element"+(value.length > 1 ? 's':'')+"]" ) );
               }
               Dom.addClass(li,'collapsed');
               Event.addListener(li, 'click', this.onItemClick, this, true);
            }
            else {
               var spanContent = '';
               if( lang.isString(value) ) {
                  spanContent = '"'+inputEx.htmlEntities(value)+'"';
               }
               else {
                  if(value === null) {
                     spanContent = "null";
                  }
                  else {
                     spanContent = value.toString();
                  }
               }
               li.appendChild( inputEx.cn('span', {className: 'type-'+(value === null ? "null" : (typeof value))}, null, spanContent ) );
            }
            
            
            ul.appendChild(li);
         }
      }
      
      parentEl.appendChild(ul);
      
      return ul;
   }
function ( obj , parentEl ) { var ul = inputEx . cn ( 'ul' , { className : 'inputEx-JsonTreeInspector' } ) ; for ( var key in obj ) { if ( obj . hasOwnProperty ( key ) ) { var value = obj [ key ] ; var id = Dom . generateId ( ) ; var li = inputEx . cn ( 'li' , { id : id } , null , key + ':' ) ; this . hash [ id ] = { value : value , expanded : false } ; if ( lang . isObject ( value ) || lang . isArray ( value ) ) { if ( lang . isArray ( value ) ) { li . appendChild ( inputEx . cn ( 'span' , null , null , "[ " + value . length + " element" + ( value . length > 1 ? 's' : '' ) + "]" ) ) ; } Dom . addClass ( li , 'collapsed' ) ; Event . addListener ( li , 'click' , this . onItemClick , this , true ) ; } else { var spanContent = '' ; if ( lang . isString ( value ) ) { spanContent = '"' + inputEx . htmlEntities ( value ) + '"' ; } else { if ( value === null ) { spanContent = "null" ; } else { spanContent = value . toString ( ) ; } } li . appendChild ( inputEx . cn ( 'span' , { className : 'type-' + ( value === null ? "null" : ( typeof value ) ) } , null , spanContent ) ) ; } ul . appendChild ( li ) ; } } parentEl . appendChild ( ul ) ; return ul ; }
Build the sub-branch for obj
Build the sub - branch for obj