()
| 241 | // print the results |
| 242 | var resultCount = results.length; |
| 243 | function displayNextItem() { |
| 244 | // results left, load the summary and display it |
| 245 | if (results.length) { |
| 246 | var item = results.pop(); |
| 247 | var listItem = $('<li style="display:none"></li>'); |
| 248 | if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') { |
| 249 | // dirhtml builder |
| 250 | var dirname = item[0] + '/'; |
| 251 | if (dirname.match(/\/index\/$/)) { |
| 252 | dirname = dirname.substring(0, dirname.length-6); |
| 253 | } else if (dirname == 'index/') { |
| 254 | dirname = ''; |
| 255 | } |
| 256 | listItem.append($('<a/>').attr('href', |
| 257 | DOCUMENTATION_OPTIONS.URL_ROOT + dirname + |
| 258 | highlightstring + item[2]).html(item[1])); |
| 259 | } else { |
| 260 | // normal html builders |
| 261 | listItem.append($('<a/>').attr('href', |
| 262 | item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + |
| 263 | highlightstring + item[2]).html(item[1])); |
| 264 | } |
| 265 | if (item[3]) { |
| 266 | listItem.append($('<span> (' + item[3] + ')</span>')); |
| 267 | Search.output.append(listItem); |
| 268 | listItem.slideDown(5, function() { |
| 269 | displayNextItem(); |
| 270 | }); |
| 271 | } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { |
| 272 | $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX, |
| 273 | dataType: "text", |
| 274 | complete: function(jqxhr, textstatus) { |
| 275 | var data = jqxhr.responseText; |
| 276 | if (data !== '' && data !== undefined) { |
| 277 | listItem.append(Search.makeSearchSummary(data, searchterms, hlterms)); |
| 278 | } |
| 279 | Search.output.append(listItem); |
| 280 | listItem.slideDown(5, function() { |
| 281 | displayNextItem(); |
| 282 | }); |
| 283 | }}); |
| 284 | } else { |
| 285 | // no source available, just display title |
| 286 | Search.output.append(listItem); |
| 287 | listItem.slideDown(5, function() { |
| 288 | displayNextItem(); |
| 289 | }); |
| 290 | } |
| 291 | } |
| 292 | // search finished, update title and status message |
| 293 | else { |
| 294 | Search.stopPulse(); |
| 295 | Search.title.text(_('Search Results')); |
| 296 | if (!resultCount) |
| 297 | Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.')); |
| 298 | else |
| 299 | Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount)); |
| 300 | Search.status.fadeIn(500); |
no test coverage detected
searching dependent graphs…