[Xapian-discuss] For more UI functionality: OmegaScript, C++ or other?

xapian at catcons.co.uk xapian at catcons.co.uk
Wed May 4 16:55:56 BST 2011


> -----Original Message-----
> Date: Tue, 26 Apr 2011 11:08:28 +0100
> From: James Aylett <james-xapian at tartarus.org>
> Subject: Re: [Xapian-discuss] For more UI functionality: OmegaScript,
> 	C++or other?
> To: Chris <chris at s-4-u.net>
> Cc: xapian-discuss at lists.xapian.org
> Message-ID: <8062E94E-7640-44CC-804A-BCC94F56E0F5 at tartarus.org>
> Content-Type: text/plain; charset=us-ascii
> 
> On 26 Apr 2011, at 10:15, Chris wrote:
> > Checkboxes support a value attribute, something like
> > 
> > <input type="checkbox" name="B" value="Edoc" /> doc
> > <input type="checkbox" name="B" value="Edocx" /> docx
> > 
> > allows searching for multiple types.
> 
> 
> I'd recommend using SELECT MULTIPLE and then if you don't 
> like the layout, use Javascript to turn it into something 
> else. Select is the appropriate form element here.
> 
> J
> 
> -- 
>  James Aylett
>  talktorex.co.uk - xapian.org - devfort.com
> 
 
Thanks Chris, James and Richard for suggestions and clarifying discussion
:-)

Sorry it has taken a while to respond; I decided to try James' suggestion
first and, following an off-list exchange (thanks James), have spent days
getting jQquery.js to load!
(http://forum.jquery.com/topic/failed-to-load-source-for-jquery-1-5-2-js).

Now jQquery.js is loading, I've got jQuery "Hello World" HTML that works
when browsed directly as a static page but not when apparently the same HTML
is produced by Omega CGI.

Here's the working HTML (/var/lib/omega/templates/index.html.  jQuery is an
Apache Alias for /opt/jQuery.  :

<html>                                                                  
<head>                                                                  
<script type="text/javascript" src="/jQuery/jquery.js"></script>          
<script type="text/javascript">                                         
  $(document).ready(function() {
    $("a").click(function() {
      alert("Hello world!");
    });
  });
</script>                                                               
</head>                                                                 
<body>                                                                  
<a href="">Link</a>
</body>                                                                 
</html>

Notes:
* In the direct case, the HTML is /var/lib/omega/templates/index.html and a
virtual host has /var/lib/omega/templates as DocumentRoot.
* In the Omega case, the same HTML is /var/lib/omega/templates/jqtry

The HTML works in the direct case. Running it as an Omega template
(&FMT=jqtry) displays "Link" as expected but clicking does not display
"Hello World".

In both cases, Firefox' View -> Page Source displays the same HTML as above
but Firebug's Script tab shows them differently.  In the direct case, it
shows the HTML; for the page produced by Omega: "No Javascript on this
page".

How could that be?!  :-)

I plan to explore checkboxes next.  

Best

Charles




More information about the Xapian-discuss mailing list