source: bookmarks/trunk/bookmark.tt @ 15

Last change on this file since 15 was 3, checked in by peter, 13 years ago
  • 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 size: 1.8 KB
Line 
1<html>
2  <head>
3    <title>Bookmark: [% title or uri %]</title>
4    <style type="text/css">
5body, th, td {
6    font-size: .875em;
7}
8li {
9    margin-bottom: .5em;
10}
11th {
12    text-align: right;
13    font-weight: normal;
14}
15    </style>
16  </head>
17  <body>
18    <div>
19      [% UNLESS exists %]
20        <strong>New bookmark:</strong>
21      [% END %]
22      <a href="[% uri %]" target="_blank">[% title or uri %]</a>
23      [% IF exists %]
24        <p class="timestamps">[% created %]</p>
25        [% IF tags.size %]
26          <p class="tags">Tagged as:
27            [% FOREACH tag IN tags %]
28              <a href=".?tag=[% tag %]" class="tag" target="_blank" onclick="if (opener && !opener.closed) { opener.location = this.href; return false; }">[% tag %]</a>
29            [% END %]
30          </p>
31        [% END %]
32      [% END %]
33      <form method="post" action="">
34        <table>
35          <tr>
36            <th>URI:</th>
37            <td>
38              <input type="text" name="uri" value="[% uri | html %]" size="80" 
39              [% IF exists %]readonly="readonly"[% END%]/>
40            </td>
41          </tr>
42          <tr>
43            <th>Title:</th>
44            <td>
45              <input type="text" name="title" value="[% title | html %]" size="80"/>
46            </td>
47          </tr>
48          <tr>
49            <th>Tags:</th>
50            <td>
51              <input type="text" name="tags" value="[% tags.join(' ') | html %]" size="80"/>
52            </td>
53          </tr>
54          <tr>
55            <th></th>
56            <td>
57              <input type="submit" value="Save"/>
58            </td>
59          </tr>
60        </table>
61      </form>
62    </div>
63    <script>
64window.onload = function() {
65    if (document.location.hash == '#updated') {
66        if (opener) {
67            opener.location.reload();
68        }
69    }
70};
71    </script>
72  </body>
73</html>
74
75<!--
76vim:syntax=html
77-->
Note: See TracBrowser for help on using the repository browser.