Changeset 3 in bookmarks for trunk/bookmark.tt


Ignore:
Timestamp:
03/02/12 20:51:06 (13 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/bookmark.tt

    r2 r3  
    2222      <a href="[% uri %]" target="_blank">[% title or uri %]</a> 
    2323      [% IF exists %] 
    24         <p>[% created %]</p> 
     24        <p class="timestamps">[% created %]</p> 
    2525        [% IF tags.size %] 
    26           <p>Tagged as: 
     26          <p class="tags">Tagged as: 
    2727            [% FOREACH tag IN tags %] 
    28               <a href="?tag=[% tag %]">[% tag %]</a> 
     28              <a href=".?tag=[% tag %]" class="tag" target="_blank" onclick="if (opener && !opener.closed) { opener.location = this.href; return false; }">[% tag %]</a> 
    2929            [% END %] 
    3030          </p> 
     
    6464window.onload = function() { 
    6565    if (document.location.hash == '#updated') { 
    66         opener.location.reload(); 
     66        if (opener) { 
     67            opener.location.reload(); 
     68        } 
    6769    } 
    6870}; 
Note: See TracChangeset for help on using the changeset viewer.