");
}
long savedLen1, savedLen2;
//
// widget
//
// put the widget in here, just sort results by spidered date
//
// the scripts do "infinite" scrolling both up and down.
// but if you are at the top then new results will load above
// you and we try to maintain your current visual state even though
// the scrollbar position will change.
//
if ( fmt == FORMAT_HTML ) {
// save position so we can output the widget code
// so user can embed it into their own web page
savedLen1 = sb.length();
sb.safePrintf("\n\n" );
long widgetWidth = 300;
long widgetHeight = 500;
// make the ajax url that gets the search results
SafeBuf ub;
ub.safePrintf("/search"
//"format=ajax"
"?c=%s"
//"&prepend=gbsortbyint%%3Agbspiderdate"
"&q=-gbstatus:0+gbsortbyint%%3Agbspiderdate"
"&sc=0" // no site clustering
"&dr=0" // no deduping
// 10 results at a time
"&n=10"
"&widgetheight=%li"
"&widgetwidth=%li"
, cr->m_coll
, widgetHeight
, widgetWidth
);
//ub.safePrintf("&topdocid="
// );
// get the search results from neo as soon as this div is
// being rendered, and set its contents to them
sb.safePrintf(//"\n\n"
// if (pos < (sd.scrollHeight-%li)) return...
// once user scrolls down to within last 5
// results then try to append to the results.
, widgetHeight +5*((long)RESULT_HEIGHT+2*PADDING)
, ub.getBufStart()
//,widgetHeight +5*((long)RESULT_HEIGHT+2*PADDING
);
// then the WIDGET MASTER div. set the "id" so that the
// style tag the user sets can control its appearance.
// when the browser loads this the ajax sets the contents
// to the reply from neo.
// on scroll call widget123_append() which will append
// more search results if we are near the bottom of the
// widget.
sb.safePrintf(" "
, widgetWidth
, widgetHeight
);
//sb.safePrintf("");
sb.safePrintf("Waiting for Server...");
// end the containing div
sb.safePrintf(" ");
savedLen2 = sb.length();
}
// the right table pane is the crawl stats
if ( fmt == FORMAT_HTML ) {
sb.safePrintf(" | ");
}
//
// show stats
//
if ( fmt == FORMAT_HTML ) {
char *seedStr = cr->m_diffbotSeeds.getBufStart();
if ( ! seedStr ) seedStr = "";
SafeBuf tmp;
long crawlStatus = -1;
getSpiderStatusMsg ( cr , &tmp , &crawlStatus );
CrawlInfo *ci = &cr->m_localCrawlInfo;
long sentAlert = (long)ci->m_sentCrawlDoneAlert;
if ( sentAlert ) sentAlert = 1;
//sb.safePrintf(
// " |