Changeset 3 in bookmarks for trunk/index.cgi


Ignore:
Timestamp:
03/02/12 20:51:06 (12 years ago)
Author:
peter
Message:
  • Added a base URL to the list, guarenteed to end in "bookmarks/"
  • Default the ?format parameer to the list to "html" to avoid the unitialized value warnings
  • Added more classes to the individual bookmark page elements
  • Added an onclick handler to the tag links in a bookmark edit form that will attempt to open the link in the opener window; failing that, they will use a new window
  • Check for an opener before attempting to reload it on page load
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.cgi

    r2 r3  
    9898            } 
    9999        } else { 
    100             #print $q->header('text/html'); 
    101             #print "TODO: list bookmarks"; 
    102             #return; 
    103             # list all the resources 
    104             my $format = $q->param('format'); 
     100            # list all the bookmarks  
     101            my $format = $q->param('format') || 'html'; 
    105102            my $tag = $q->param('tag'); 
    106103            my @resources = $bookmarks->get_resources({ tag => $tag }); 
     
    123120                    -charset => 'UTF-8', 
    124121                ); 
     122 
     123                # set the base URL, adding a trailing slash if needed 
     124                my $base_url = $q->url; 
     125                $base_url .= '/' if $base_url =~ m{/bookmarks$}; 
     126 
    125127                $template->process( 
    126128                    'list.tt', 
    127129                    { 
     130                        base_url     => $base_url, 
    128131                        selected_tag => $tag, 
    129132                        tags         => \@all_tags, 
Note: See TracChangeset for help on using the changeset viewer.