Modified search.js

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Modified search.js

Alex Finch

Further to my earlier post "Extending syntax of external searches." I have also modified the file templates/html/extsearch.js to
modify the format of the output of the search . Again I am posting it here in the hope someone finds it useful.

In "function(data)" :

r+='<tr class="searchresult">'+
            '<td align="right">'+(data.first+i+1)+'.</td>'+
            '<td>  (<span style="font-style:italic;"> <a href="'+escapeHtml(prefix)+'">'+escapeHtml(item.tag)+'</a></span>)
                 '<a href="'+escapeHtml(prefix+item.url)+

For each item I include a hyperlink to the top of the package from which the item was found.

and I added a "fail()" method to give a response when doxysearch.cgi returns an error, for example if the wildcard search exceeds
its limit:

  } else {
           function(jqXHR, textStatus, errorThrown){
                   var results = $('#searchresults');
                   var response=jqXHR.responseText;
                   response = response.replace('(','');
                   response = response.replace(')','');
                   results.html('<h1> Your Search Failed</h1> ');
                   var error = JSON.parse(response);

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Doxygen-users mailing list
[hidden email]