source: bookmarks/trunk/index.cgi @ 26

Last change on this file since 26 was 23, checked in by peter, 12 years ago

use the subclass style of CGI::Application::Dispatch

  • Property svn:executable set to *
File size: 821 bytes
RevLine 
[2]1#!/usr/bin/perl -w
2use strict;
3
4# bookmarklet to add a bookmark via the browser
5# javascript:(function(){window.open("http://grim.ath.cx/~peter/bookmarks?uri="+document.location+"&title="+document.title,"edit_bookmark","width=800,height=250")})()
6
[23]7package BookmarkApp::Dispatch;
8use base 'CGI::Application::Dispatch';
9
10sub dispatch_args {
11    return {
12        table => [
13            '[get]'              => { app => 'BookmarkApp', rm => 'list' },
14            'list[get]'          => { app => 'BookmarkApp', rm => 'list' },
15            'feed[get]'          => { app => 'BookmarkApp', rm => 'feed' },
16            ':id/:field?[get]'   => { app => 'BookmarkApp', rm => 'view' },
17            ':id?[post]'         => { app => 'BookmarkApp', rm => 'edit' },
18        ],
19    };
20}
21
22package main;
23BookmarkApp::Dispatch->dispatch();
Note: See TracBrowser for help on using the repository browser.