projects/booket

changeset 2:82c50265c8dc

Display creation and modification time
author Guido Berhoerster <guido+booket@berhoerster.name>
date Mon Sep 08 19:34:11 2014 +0200 (2014-09-08)
parents 6559033d9996
children 4786df0aec03
files booket.css booket.html booket.js
line diff
     1.1 --- a/booket.css	Sat Sep 06 18:20:15 2014 +0200
     1.2 +++ b/booket.css	Mon Sep 08 19:34:11 2014 +0200
     1.3 @@ -283,3 +283,22 @@
     1.4  a.bookmark-link:visited:active {
     1.5      color: #07316e;
     1.6  }
     1.7 +
     1.8 +dl.bookmark-metadata {
     1.9 +    color: #555753;
    1.10 +    font-size: .75em;
    1.11 +    margin: .25em 0 0 0;
    1.12 +}
    1.13 +
    1.14 +dl.bookmark-metadata dt {
    1.15 +    font-weight: bold;
    1.16 +}
    1.17 +
    1.18 +dl.bookmark-metadata dt::after {
    1.19 +    content: ':';
    1.20 +}
    1.21 +
    1.22 +dl.bookmark-metadata dd {
    1.23 +    margin: 0;
    1.24 +    padding: 0;
    1.25 +}
     2.1 --- a/booket.html	Sat Sep 06 18:20:15 2014 +0200
     2.2 +++ b/booket.html	Mon Sep 08 19:34:11 2014 +0200
     2.3 @@ -138,6 +138,12 @@
     2.4                <button type="button" name="edit-bookmark">Edit</button><button
     2.5                type="button" name="delete-bookmark">Delete</button>
     2.6              </div>
     2.7 +            <dl class="bookmark-metadata">
     2.8 +              <dt>Added</dt>
     2.9 +              <dd><time class="ctime"></time></dd>
    2.10 +              <dt>Last modified</dt>
    2.11 +              <dd><time class="mtime"></time></dd>
    2.12 +            </dl>
    2.13            </li>
    2.14          </template>
    2.15        </ul>
     3.1 --- a/booket.js	Sat Sep 06 18:20:15 2014 +0200
     3.2 +++ b/booket.js	Mon Sep 08 19:34:11 2014 +0200
     3.3 @@ -1031,6 +1031,8 @@
     3.4      var newNode;
     3.5      var bookmarkElement;
     3.6      var linkElement;
     3.7 +    var ctimeElement;
     3.8 +    var mtimeElement;
     3.9      var tagListElement;
    3.10  
    3.11      newNode = document.importNode(this.bookmarkTemplate.content, true);
    3.12 @@ -1042,6 +1044,14 @@
    3.13      linkElement.textContent = linkElement.title = bookmark.title;
    3.14      linkElement.href = bookmark.url;
    3.15  
    3.16 +    ctimeElement = bookmarkElement.querySelector('.ctime');
    3.17 +    ctimeElement.dateTime = bookmark.ctime.toISOString();
    3.18 +    ctimeElement.textContent = bookmark.ctime.toString();
    3.19 +
    3.20 +    mtimeElement = bookmarkElement.querySelector('.mtime');
    3.21 +    mtimeElement.dateTime = bookmark.mtime.toISOString();
    3.22 +    mtimeElement.textContent = bookmark.mtime.toString();
    3.23 +
    3.24      tagListElement = bookmarkElement.querySelector('ul.tag-list');
    3.25      bookmark.tags.forEach(function (tag) {
    3.26          var newNode;