CGI-Application-Search

 view release on metacpan or  search on metacpan

templates/ajax_search_results.tt  view on Meta::CPAN

<!--

EXAMPLE TEMPLATE

Designed to be used for the TEMPLATE configuration with
a TEMPLATE_TYPE of 'TemplateToolkit'. This
should be used in conjunction with the AJAX configuration param
(but not as the AJAX template; that's 'ajax_results_listing.tt')

This template demonstrates the following features of C::A::Search:

  AJAX search (contains necessary Javascript calls)
  AUTO_SUGGEST (contains necessary Javascript calls)
  highlight_local_page (contains link with appropriate parameters)

-->

[% UNLESS ajax %]

<html>
<head>
<!--
  Prototype and Scriptaculous Javascript libraries
  Latest versions available at http://script.aculo.us/

  It's best to use the following <script> tags with a 'src'
  attribute to remotely pull this JS code in since that allows
  the browser to cache the compiled JS code, instead of reparsing
  and compiling it on each request.

  <script src="/prototype.js" type="text/javascript"></script>
  <script src="/scriptaculous.js" type="text/javascript"></script>

  But for the example templates, we'll just include it in there
-->
[% INCLUDE 'prototype_javascript.tmpl' %]

<!--
  auto_complete styles needed for AUTO_SUGGEST functionality
-->
<style>

label {
    font-weight: bold;
}
div.pagination {
    background: #eff7e9;
    border: 1px solid #888888;
}
div.auto_complete {
    width: 350px;
    background: #fff;
}
div.auto_complete ul {
    border:1px solid #888;
    margin:0;
    padding:0;
    width:100%;
    list-style-type:none;
}
div.auto_complete ul li {
    margin:0;
    padding:3px;
}
div.auto_complete ul li.selected {
    background-color: #B82619;
    color: #ffffff;
}
div.auto_complete ul strong.highlight {
    color: #800;
    margin:0;
    padding:0;
}
</style>

</head>
<body>

<h2>Search[% IF searched %] Results[% END %]</h2>

<form id="search" name="search" onsubmit="return ajax_form_search(this);" >
<input name="rm" value="perform_search" type="hidden">

<table summary="layout">
<tr>
  <td><label for="keywords">Keyword(s)</label></td>
  <td colspan="2">
    <input id="keywords" name="keywords" value="" size="50" autocomplete="off">
    <div class="auto_complete" id="keywords_auto_complete"></div>
  </td>
</tr>
<tr>
  <td colspan="2" align="right"><input value="Search" type="submit" name=".submit"></td>
</tr>
</table>

</form>

<script type="text/javascript">
<!--
// THIS IS THE URL of the search app. The Ajax JS libraries need it
var url = '[% url %]';
new Ajax.Autocompleter( 'keywords', 'keywords_auto_complete', url, { parameters: "rm=suggestions"  })
//-->



( run in 1.954 second using v1.01-cache-2.11-cpan-a49fcb8fa48 )