Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

singingfish (7494)

singingfish
  (email not shown publicly)

Journal of singingfish (7494)

Monday September 24, 2007
06:22 PM

Catalyst::Controller::reCAPTCHA

Just a quick note to let you all know that I made a Catalyst extension to interact with the reCAPTCHA service.

It's Catalyst::Controller::reCAPTCHA on cpan and comes with documentation and a simple example application. If anyone wants to add patches for Captcha::reCAPTCHA::Mailhide api, feel free :-)

By the way, watch out for testing this on your dev box - I got myself banned from reCaptcha for several hours by posting continually failing recaptchas.

Monday September 17, 2007
12:40 AM

WIAB hits version 0.02

WIAB - Website in a box, my simple Catalyst CMS has hit version 0.02. The main change here is that we're using some Jquery code to make editing pages easier. The plugin in question is JTagEditor. You can download the new version from here.
Friday June 01, 2007
07:36 AM

Catalyst Javascript Testbed

Quick way to get a javascript testbed going:

$ catalyst.pl MyApp
$ cd MyApp

# put this in MyApp::Controller::Root

sub default : Path {
        my ( $self, $c, $arg ) = @_;

        unless ($arg =~ /boo|hoo|snoo/) {
                $c->res->status('404');
                $c->res->body('404 not found');
        }
        else {
                $c->config->{$arg}++;
                $c->res->header('Content-Type', 'text/plain');
                $c->res->body($c->config->{$arg});
        }
}

sub index : Private {
        my ($self, $c) = @_;
        $c->res->redirect($c->uri_for('/static/index.htm'));
}

# download your js libraries of choice (jquery here) to root/static/js (create dir as nescessary)
# And in /static/index.htm <-- NOTE the lack of 'l' at the end - there is a reason for this!

<html><head></head><body>
<script src="/static/js/jquery-1.1.2.pack.js"></script>
<script type="text/javascript">
    jq = jQuery.noConflict(); // your stuff here :-)
<script>
# your html here pre-written or inserted with js debugger
</body></html>

Woosh, off we go...
Monday May 07, 2007
08:56 AM

WIAB templates

I'm uncrufting WIAB's templates based on the list apart three column layout. I've removed a column and glued on a simple css layer for the breadcrumbs to present a tab like interface. Once I've styled the left menu, and the footer, I can think about providing drop down menus. Then I make the colour scheme sane and we have a new release!
Tuesday April 24, 2007
12:49 AM

Javascript n00b part 1

Unfortunately, javascript is a pain, but getting better. Unfortunately there seem to be a few good books out there, and none of them in my local library. Time to create my own resource for learning javascript! WTFM indeed. So following the advice of people who know, I downloaded the Core Javascript Guide. To give myself an interactive environment for learning Javascript I downloaded Firebug and off we go.

First up is the chapter on variables. Open up the Firebug inspector (a green tick in the lower rhs of my browser here) and declare a string in the interaction line (right at the bottom of the window with three blue angle brackets (>>>) like so:

a = "Hi";

Then: window.alert(a);

There we go, scalar variable naming and browser interactivity all in one go. Next up the rest of the chapter.

BTW while this isn't directly relevant to Catalyst, people do pop up on IRC asking for the "best javascript book" and the approach above seems a reasonable substitute.

Update: I found the little gray V at the far right hand side of the firebug eval area in firebug. Turns out you can eval blocks of code too :) :

a = 'foo'; b= 'bar'; if (a == 'foo' && b != 'bar') { window.alert(a)} else { window.alert(b) }

Update: (again). A little birdie tells me that I should declare my variables with var a = 'Hi'. Something to do with scoping issues. I guess once I understand how to do data structures in javascript I'll be working out scope and how to do something "use strict" like.

Wednesday March 28, 2007
03:33 AM

WIAB Updates

I've been poking Website in a box a little since it's public release. I added reasonable documentation for deployment administration and editing. I also updated the TODO realising I forgot to do that before. Here it is in aproximate order at subversion revision 103:
  1. Clean templates add styled to forms and release non js stable version
  2. Wysywig dojo editor
  3. Par deployment
  4. Orderable menus (javascript only)
  5. Internal links and image addresses via textile/dojo plugin
  6. Make images slightly easier to deal with.
  7. Provide image upload area (with auto-resize?)
  8. Sensible cacheing (pref a static file cache so pages only need to be generated once).
  9. Remove remaining warnings (also ongoing)

Along the way to getting Dojo into WIAB, I found an "interesting" interaction bug between Template::Plugin::CGI and the built in Catalyst test server... Must report that problem. Something to do with CGI expecting stuff from STDIN at inappropriate times.

Naturally if I have any volunteers for any of the above jobs ...

Tuesday March 20, 2007
07:33 PM

Website in a Box

Website in a box is a Catalyst based content management system for individuals and small groups. It's got Google Code project space and a reasonably comprehensive test suite. It does some "Search Engine Optimisation" for you and has been built to be easy to hack on.

It's also a nice application to look at if you want to learn Catalyst.