external/bbop.js
function(request_data, response_hook) {
	    anchor.jq_vars['success'] = function(json_data){
		var retlist = [];
		var resp = new bbop.golr.response(json_data);

		// Reset the last return; remember: tri-state.
		result_count = null;
		return_count = null;

		if( resp.success() ){

		    // Get best shot at document counts.
		    result_count = resp.total_documents();
		    return_count = resp.documents().length;

		    loop(resp.documents(),
			 function(doc){

			     // First, try and pull what we can out of our
			     var lbl = label_tt.fill(doc);

			     // Now the same thing for the return/value.
			     var val = value_tt.fill(doc);

			     // Add the discovered items to the return
			     // save.
			     var item = {
				 'label': lbl,
				 'value': val,
				 'document': doc
			     };
			     retlist.push(item);
			 });
		}
		response_hook(retlist);
	    };

	    // Get the selected term into the manager and fire.
	    //anchor.set_query(request_data.term);
	    anchor.set_comfy_query(request_data.term);
	    anchor.JQ.ajax(anchor.get_query_url(), anchor.jq_vars);
	}
function(request_data, response_hook) {
	    anchor.jq_vars['success'] = function(json_data){
		var retlist = [];
		var resp = new bbop.golr.response(json_data);

		// Reset the last return; remember: tri-state.
		result_count = null;
		return_count = null;

		if( resp.success() ){

		    // Get best shot at document counts.
		    result_count = resp.total_documents();
		    return_count = resp.documents().length;

		    loop(resp.documents(),
			 function(doc){

			     // First, try and pull what we can out of our
			     var lbl = label_tt.fill(doc);

			     // Now the same thing for the return/value.
			     var val = value_tt.fill(doc);

			     // Add the discovered items to the return
			     // save.
			     var item = {
				 'label': lbl,
				 'value': val,
				 'document': doc
			     };
			     retlist.push(item);
			 });
		}
		response_hook(retlist);
	    };

	    // Get the selected term into the manager and fire.
	    //anchor.set_query(request_data.term);
	    anchor.set_comfy_query(request_data.term);
	    anchor.JQ.ajax(anchor.get_query_url(), anchor.jq_vars);
	}
function ( request_data , response_hook ) { anchor . jq_vars [ 'success' ] = function ( json_data ) { var retlist = [ ] ; var resp = new bbop . golr . response ( json_data ) ; // Reset the last return; remember: tri-state. result_count = null ; return_count = null ; if ( resp . success ( ) ) { // Get best shot at document counts. result_count = resp . total_documents ( ) ; return_count = resp . documents ( ) . length ; loop ( resp . documents ( ) , function ( doc ) { // First, try and pull what we can out of our var lbl = label_tt . fill ( doc ) ; // Now the same thing for the return/value. var val = value_tt . fill ( doc ) ; // Add the discovered items to the return // save. var item = { 'label' : lbl , 'value' : val , 'document' : doc } ; retlist . push ( item ) ; } ) ; } response_hook ( retlist ) ; } ; // Get the selected term into the manager and fire. //anchor.set_query(request_data.term); anchor . set_comfy_query ( request_data . term ) ; anchor . JQ . ajax ( anchor . get_query_url ( ) , anchor . jq_vars ) ; }
Function for a successful data hit. The data getter, which is making it all more complicated than it needs to be...we need to close around those callback hooks so we have to do it inplace here.
Function for a successful data hit . The data getter which is making it all more complicated than it needs to be ... we need to close around those callback hooks so we have to do it inplace here .