Grokbase
x

Michael Reece (m...@sacbee.com)

Profile | Posts (13)

User Information

Display Name:Michael Reece
Partial Email Address:m...@sacbee.com
Posts:
13 total
13 in Catalyst Framework

5 Most Recent

All Posts
1) Michael Reece [Catalyst] http://www.pcklus.nl/catalyst_auto_complete_take1.mov
| +1 vote
yep, thanks! > Andreas/omega...
Catalyst Framework
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
yep, thanks!


On Jul 15, 2005, at 3:49 PM, Andreas Marienborg wrote:

>
> On 15. jul. 2005, at 18.36, michael reece wrote:
>
>> <!-- some docs on why this needs autocomplete="off" would be nice -->
>> <input autocomplete="off" id="complete_me" name="complete_me"
>> type="text" />
>>
>
> It needs autocomplete="off" to supress the "regular" autocompletion
> that most modern
> browsers have. Mozilla/firefox for instance remembers values based
> on the name of the field
> and it sorta squashes the autocomplete we make, cause it gets in
> the way, and confuses alot.
>
> Helped a little?
>
> Andreas/omega
2) Michael Reece [Catalyst] http://www.pcklus.nl/catalyst_auto_complete_take1.mov
| +1 vote
for those who can't watch the video, here's a snippet that uses Mason instead of TT: the template...
Catalyst Framework
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
for those who can't watch the video, here's a snippet that uses Mason  
instead of TT:

the template (autocomplete):

<% $c->prototype->define_javascript_functions %>
<% $c->prototype->auto_complete_stylesheet %>

<!-- some docs on why this needs autocomplete="off" would be nice -->
<input autocomplete="off" id="complete_me" name="complete_me"  
type="text" />
<div class="auto_complete" id="complete_me_auto_complete"></div>

<% $c->prototype->auto_complete_field( 'complete_me', { url =>  
$base . 'autocomplete/suggest' } ) %>


the controller (AutoComplete.pm):

sub default : Private {
     my ( $self, $c ) = @_;
     $c->stash->{template} = 'autocomplete';
}

sub suggest : Local {
     my ( $self, $c ) = @_;
     my $complete_me = $c->req->params->{complete_me};
     my @suggestions;
     push @suggestions, "$complete_me $_" foreach (1..5);
     $c->res->output( $c->prototype->auto_complete_result 
( \@suggestions ) );
}



here's how easy it was to do the same thing with a db query:

sub suggest : Local {
     my ( $self, $c ) = @_;
     my $complete_me = $c->req->params->{complete_me};
     my @suggestions;
     if ( $complete_me ) {
         my $today = localtime->mysql_date;  # from Time::Piece::MySQL
         my @s = MyApp::CDBI::Story->search_like(headline => "$ 
{complete_me}%", pubdate => $today);
         push @suggestions, $_->headline foreach @s;
     }
     $c->res->output( $c->prototype->auto_complete_result 
( \@suggestions ) );
}



On Jul 15, 2005, at 9:14 AM, Mike McKay wrote:

>
>
>
>>> 404 *cough*. :)
>>>
>> Yes, his provider didn't liked all the traffic recently. :)
>> Here's a list of other mirrors.
>>
>
> How about a code snippet showing how easy it is? And maybe a link
> to a site where we can try it out? 15MB doesn't work for those of
> us on dialup!
>
> Mike
>
>
> _______________________________________________
> Catalyst mailing list
> [email protected: Cat...@lists.rawmode.org]
> http://lists.rawmode.org/mailman/listinfo/catalyst
>

-----
michael reece :: web engineer :: [email protected: m...@sacbee.com]
3) Michael Reece [Catalyst] Catalyst movies!
| +1 vote
thanks for the very simple autocomplete example! very cool. michael reece :: web engineer ::...
Catalyst Framework
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
thanks for the very simple autocomplete example!  very cool.

On Jul 14, 2005, at 6:07 AM, Sebastian Riedel wrote:

> Ok, here's my first try to make a Catalyst movie, don't overload
> the server.
> http://files.oook.de/catalyst_auto_complete_take1.mov
>
> Hope there will be more soon, so feel free to produce your own (and
> become famous!). ;)
>
> Note that the example in the movie requires HTML::Prototype 1.32,
> which i just uploaded. (also available in trunk)
>
> --
> sebastian
>
>
> _______________________________________________
> Catalyst mailing list
> [email protected: Cat...@lists.rawmode.org]
> http://lists.rawmode.org/mailman/listinfo/catalyst
>

-----
michael reece :: web engineer :: [email protected: m...@sacbee.com]
4) Michael Reece [Catalyst] How to configure multiple Apps with mod_perl?
| +1 vote
This seems to fix it, and sri says he will work it into trunk: Add the following lines to...
Catalyst Framework
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
This seems to fix it, and sri says he will work it into trunk:

Add the following lines to Dispatcher.pm's sub setup_actions:


   sub setup_actions {
      my ( $self, $comps ) = @_;

+    $self->actions(
+ { plain => {}, private => {}, regex => {}, compiled => [],
reverse => {} }
+    );
+    $self->tree( Tree::Simple->new( 0, Tree::Simple->ROOT ) );
+
      for my $comp (@$comps) {
          $comp = ref $comp || $comp;


don't know if there is still a problem with attrcache ..



On May 13, 2005, at 7:16 PM, n.a wrote:

> I want to build multiple Catalyst applications in one host
> with apache/mod_perl(1.29).
>
> It seems the memory reuse mechanism of mod_perl makes problem in this
> case. Request for one application unintentionally maps to an other
> application handler once in a while after several requests.
>
>
> Are there any way to avoid this?
>
>
> Just for a quick hack, I add following lines to my application classes
> to separate actions look up table among different Catalyst
> applications.
>
> However I'm not sure if this is enough.
>
> BEGIN{
>     __PACKAGE__->actions({}),
>     __PACKAGE__->_attrcache({});
> }
>
>
> Version Info
>   Catalyst '5.10'
> Apache-perl : 1.3.33-4 (debian package with mod_perl/1.29)
>   OS Linux/Debian Linux version 2.4.27-1-386
> --
> [email protected: n...@ad.wakwak.com]
>
>
> _______________________________________________
> Catalyst mailing list
> [email protected: Cat...@lists.rawmode.org]
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
5) Michael Reece [Catalyst] thefeed.no runs on mojomojo
| +1 vote
fyi the homepage for thefeed.no causes safari 2.0 (osx tiger) to crash .. ...
Catalyst Framework
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
fyi the homepage for thefeed.no causes safari 2.0 (osx tiger) to  
crash ..



On May 9, 2005, at 8:56 AM, Jose Nyimi wrote:

> As announced at
> http://use.perl.org/~draven/journal
>
> But try to click on "Authors" link (http://thefeed.no/.users)
> And see the error message ...
>
> Hum, this is not good for the image of Cat ;)
>
> R,
> Jos?.
>
>
>
> _______________________________________________
> Catalyst mailing list
> [email protected: Cat...@lists.rawmode.org]
> http://lists.rawmode.org/mailman/listinfo/catalyst
>

spacer
Profile | Posts (13)
Home > People > Michael Reece