external/bbop.js
function(layout_level){
		 loop(layout_level, // for every item at this level
		      function(level_item){			  

			  var nid = level_item[0];
			  var lbl = level_item[1];
			  var rel = level_item[2];
			  
			  // For various sections, decide to run image
			  // (img) or text code depending on whether
			  // or not it looks like we have a real URL.
			  var use_img_p = true;
			  if( base_icon_url == null || base_icon_url == '' ){
			      use_img_p = false;
			  }

			  // Clickable acc span.
			  // No images, so the same either way. Ignore
			  // it if we're current.
			  var nav_b = null;
			  if(anchor._current_acc == nid){
			      var inact_attrs = {
				  'class': 'bbop-js-text-button-sim-inactive',
				  'title': 'Current term.'
			      };
			      nav_b = new bbop.html.span(nid, inact_attrs);
			  }else{
			      var tbs = bbop.widget.display.text_button_sim;
			      var bttn_title =
				  'Reorient neighborhood onto this node (' +
				  nid + ').';
			      nav_b = new tbs(nid, bttn_title);
			      nav_button_hash[nav_b.get_id()] = nid;
			  }

			  // Clickable info span. A little difference
			  // if we have images.
			  var info_b = null;
			  if( use_img_p ){
			      // Do the icon version.
			      var imgsrc = bbop.core.resourcify(base_icon_url,
								info_icon,
								image_type);
			      info_b =
				  new bbop.html.image({'alt': info_alt,
						       'title': info_alt,
				  		       'src': imgsrc,
				  		       'generate_id': true});
			  }else{
			      // Do a text-only version.
			      info_b =
				  new bbop.html.span('<b>[i]</b>',
						     {'generate_id': true});
			  }
			  info_button_hash[info_b.get_id()] = nid;

			  // "Icon". If base_icon_url is defined as
			  // something try for images, otherwise fall
			  // back to this text ick.
			  var icon = null;
			  if( use_img_p ){
			      // Do the icon version.
			      var ialt = '[' + rel + ']';
			      var isrc = null;
			      if(anchor._current_acc == nid){
				  isrc = bbop.core.resourcify(base_icon_url,
			      				      current_icon,
							      image_type);
			      }else{
				  isrc = bbop.core.resourcify(base_icon_url,
			      				      rel, image_type);
			      }
			      icon =
				  new bbop.html.image({'alt': ialt,
						       'title': rel,
				  		       'src': isrc,
				  		       'generate_id': true});
			  }else{
			      // Do a text-only version.
			      if(anchor._current_acc == nid){
				  icon = '[[->]]';
			      }else if( rel && rel.length && rel.length > 0 ){
				  icon = '[' + rel + ']';
			      }else{
				  icon = '[???]';
			      }
			  }

			  // Stack the info, with the additional
			  // spaces, into the div.
			  top_level.add_to(spaces,
					   icon,
					   nav_b.to_string(),
					   lbl,
					   info_b.to_string());
		      }); 
		 spaces = spaces + spacing;
	     }
function(layout_level){
		 loop(layout_level, // for every item at this level
		      function(level_item){			  

			  var nid = level_item[0];
			  var lbl = level_item[1];
			  var rel = level_item[2];
			  
			  // For various sections, decide to run image
			  // (img) or text code depending on whether
			  // or not it looks like we have a real URL.
			  var use_img_p = true;
			  if( base_icon_url == null || base_icon_url == '' ){
			      use_img_p = false;
			  }

			  // Clickable acc span.
			  // No images, so the same either way. Ignore
			  // it if we're current.
			  var nav_b = null;
			  if(anchor._current_acc == nid){
			      var inact_attrs = {
				  'class': 'bbop-js-text-button-sim-inactive',
				  'title': 'Current term.'
			      };
			      nav_b = new bbop.html.span(nid, inact_attrs);
			  }else{
			      var tbs = bbop.widget.display.text_button_sim;
			      var bttn_title =
				  'Reorient neighborhood onto this node (' +
				  nid + ').';
			      nav_b = new tbs(nid, bttn_title);
			      nav_button_hash[nav_b.get_id()] = nid;
			  }

			  // Clickable info span. A little difference
			  // if we have images.
			  var info_b = null;
			  if( use_img_p ){
			      // Do the icon version.
			      var imgsrc = bbop.core.resourcify(base_icon_url,
								info_icon,
								image_type);
			      info_b =
				  new bbop.html.image({'alt': info_alt,
						       'title': info_alt,
				  		       'src': imgsrc,
				  		       'generate_id': true});
			  }else{
			      // Do a text-only version.
			      info_b =
				  new bbop.html.span('<b>[i]</b>',
						     {'generate_id': true});
			  }
			  info_button_hash[info_b.get_id()] = nid;

			  // "Icon". If base_icon_url is defined as
			  // something try for images, otherwise fall
			  // back to this text ick.
			  var icon = null;
			  if( use_img_p ){
			      // Do the icon version.
			      var ialt = '[' + rel + ']';
			      var isrc = null;
			      if(anchor._current_acc == nid){
				  isrc = bbop.core.resourcify(base_icon_url,
			      				      current_icon,
							      image_type);
			      }else{
				  isrc = bbop.core.resourcify(base_icon_url,
			      				      rel, image_type);
			      }
			      icon =
				  new bbop.html.image({'alt': ialt,
						       'title': rel,
				  		       'src': isrc,
				  		       'generate_id': true});
			  }else{
			      // Do a text-only version.
			      if(anchor._current_acc == nid){
				  icon = '[[->]]';
			      }else if( rel && rel.length && rel.length > 0 ){
				  icon = '[' + rel + ']';
			      }else{
				  icon = '[???]';
			      }
			  }

			  // Stack the info, with the additional
			  // spaces, into the div.
			  top_level.add_to(spaces,
					   icon,
					   nav_b.to_string(),
					   lbl,
					   info_b.to_string());
		      }); 
		 spaces = spaces + spacing;
	     }
function ( layout_level ) { loop ( layout_level , // for every item at this level function ( level_item ) { var nid = level_item [ 0 ] ; var lbl = level_item [ 1 ] ; var rel = level_item [ 2 ] ; // For various sections, decide to run image // (img) or text code depending on whether // or not it looks like we have a real URL. var use_img_p = true ; if ( base_icon_url == null || base_icon_url == '' ) { use_img_p = false ; } // Clickable acc span. // No images, so the same either way. Ignore // it if we're current. var nav_b = null ; if ( anchor . _current_acc == nid ) { var inact_attrs = { 'class' : 'bbop-js-text-button-sim-inactive' , 'title' : 'Current term.' } ; nav_b = new bbop . html . span ( nid , inact_attrs ) ; } else { var tbs = bbop . widget . display . text_button_sim ; var bttn_title = 'Reorient neighborhood onto this node (' + nid + ').' ; nav_b = new tbs ( nid , bttn_title ) ; nav_button_hash [ nav_b . get_id ( ) ] = nid ; } // Clickable info span. A little difference // if we have images. var info_b = null ; if ( use_img_p ) { // Do the icon version. var imgsrc = bbop . core . resourcify ( base_icon_url , info_icon , image_type ) ; info_b = new bbop . html . image ( { 'alt' : info_alt , 'title' : info_alt , 'src' : imgsrc , 'generate_id' : true } ) ; } else { // Do a text-only version. info_b = new bbop . html . span ( '<b>[i]</b>' , { 'generate_id' : true } ) ; } info_button_hash [ info_b . get_id ( ) ] = nid ; // "Icon". If base_icon_url is defined as // something try for images, otherwise fall // back to this text ick. var icon = null ; if ( use_img_p ) { // Do the icon version. var ialt = '[' + rel + ']' ; var isrc = null ; if ( anchor . _current_acc == nid ) { isrc = bbop . core . resourcify ( base_icon_url , current_icon , image_type ) ; } else { isrc = bbop . core . resourcify ( base_icon_url , rel , image_type ) ; } icon = new bbop . html . image ( { 'alt' : ialt , 'title' : rel , 'src' : isrc , 'generate_id' : true } ) ; } else { // Do a text-only version. if ( anchor . _current_acc == nid ) { icon = '[[->]]' ; } else if ( rel && rel . length && rel . length > 0 ) { icon = '[' + rel + ']' ; } else { icon = '[???]' ; } } // Stack the info, with the additional // spaces, into the div. top_level . add_to ( spaces , icon , nav_b . to_string ( ) , lbl , info_b . to_string ( ) ) ; } ) ; spaces = spaces + spacing ; }
for every level
for every level